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 (v3) 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:
You should:
This Lab will start with the following AWS resources provisioned automatically for you:
To achieve the Lab end state, you will be walked through the process of:
January 3rd, 2022 - Updated code block
December 15th, 2021 - Updated the indentation of some code blocks
August 14th, 2020 - Fixed expired certs issue preventing Kubernetes environment from starting
September 28th, 2021 - Updated to use K8s 1.22 and Helm 3
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, Azure, GCP), Security, Kubernetes, and Machine Learning.
Jeremy holds professional certifications for AWS, Azure, GCP, Terraform, Kubernetes (CKA, CKAD, CKS).