Ready for the real environment experience?
Creating well structured, declarative, and reusable deployments within Kubernetes is an essential skill which increases productivity. Using the right cluster resources for the right job, combined with knowing how to templatize your setups minimises the risk of making mistakes across multiple environments and helps to reduce ongoing maintenance. This Lab will introduce you to the concept of a manifest file, used for declaring your cluster resources, together with Helm which can be used to templatize your manifests.
In this Lab scenario you'll work with 2 containers. An NGINX web server container will be configured to proxy incoming HTTP requests downstream to another container running a customised FLASK based web application. The NGINX web server container will use the publicly available nginx:1.13.7 image. The FLASK based web application container will be based on a custom docker image that you will need to first create.
This Lab will teach you how to create a ConfigMap manifest file, and a Deployment manifest file. You will then use the kubectl apply command to create both resources within a Kubernetes cluster. You'll then learn how to use Helm to reconstruct the entire deployment using templates, allowing you to create and deploy environment specific versions, dev and prod, of the deployment within the cluster.
Upon completion of this Lab, you will be able to:
- Use the docker build command to build a new Docker Image and tag it with cloudacademydevops/flaskapp:latest
- Update and edit a nginx.configmap.yaml manifest to create a Deployment resource
- Update and edit a deployment.yaml manifest to create a ConfigMap resource
- Use the kubectl apply command to perform a deployment using the updated manifest files into the Kubernetes cluster
- Update and edit a Helm deployment.yaml template
- Update and edit a Helm values.yaml file
- Use the helm template command together with the kubectl apply command to perform a deployment using templates into the Kubernetes cluster
- Create and edit Helm environment specific value files: values.dev.yaml and values.prod.yaml
- Use the helm template command together with the kubectl apply command to perform a dev deployment into the Kubernetes cluster
- Use the helm template command together with the kubectl apply command to perform a prod deployment into the Kubernetes cluster
- Test and validate the container setup using the curl command
- Be comfortable with basic Linux command line administration
- Be comfortable with basic container concepts
This Lab will start with the following AWS resources provisioned automatically for you:
- A single EC2 instance, named ide.containers.cloudacademy.platform.instance, which will have a public IP address attached. This will be the instance that you will connect to using your local workstation browser.
To achieve the Lab end state, you will be walked through the process of:
- Using your local workstation browser to remotely connect to ide.containers.cloudacademy.platform.instance
- Using the web based IDE and integrated terminal, you'll complete the remainder of the stated Lab Objectives (above)
August 14th, 2020 - Fixed issue preventing Kubernetes environment from starting
Jeremy is a Content Lead Architect and DevOps SME here at Cloud Academy where he specializes in developing DevOps technical training documentation.
He has a strong background in software engineering, and has been coding with various languages, frameworks, and systems for the past 25+ years. In recent times, Jeremy has been focused on DevOps, Cloud (AWS, GCP, Azure), Security, Kubernetes, and Machine Learning.
Jeremy holds professional certifications for AWS, GCP, and Kubernetes.