Performing a Kubernetes Deployment using ConfigMaps and Helm

Lab Steps

lock
Logging in to the Amazon Web Services Console
lock
Connecting to the CloudAcademy Web based Containers IDE Port 8080
lock
Perform Image Build and Create Namespace
lock
Apply Nginx ConfigMap
lock
Apply Deployment
lock
Create Helm Project
lock
Update Deployment to Use Helm Templates

Ready for the real environment experience?

DifficultyIntermediate
Time Limit2h 30m
Students70
Ratings
5/5
star star star star star

Description

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.

 

Lab Objectives

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

You should:

  • Be comfortable with basic Linux command line administration
  • Be comfortable with basic container concepts

Lab Environment

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)

 

About the Author

Students22464
Labs32
Courses81
Learning paths19

Jeremy is the DevOps Content Lead at Cloud Academy where he specializes in developing technical training documentation for DevOps.

He has a strong background in software engineering, and has been coding with various languages, frameworks, and systems for the past 20+ years. In recent times, Jeremy has been focused on DevOps, Cloud, Security, and Machine Learning.

Jeremy holds professional certifications for both the AWS and GCP cloud platforms.
 

Covered Topics