Scaling Kubernetes Deployments Up and Down
Description
If you're building and deploying cloud native applications and microservices, then Kubernetes is the goto container platform. Kubernetes provides superior container-orchestration, deployment, scaling, and management. Being able to deploy and scale applications within Kubernetes the right way is a skill that needs to be mastered.
In this Lab scenario you'll work with a single container - a basic FLASK based web application. The FLASK based web application container will be based on a custom docker image that you will need to first create.
This Lab will then teach you how to use the kubectl command to create a basic deployment of the FLASK based web application within a Kubernetes cluster. You'll learn how to use the kubectl command to expose the deployment and how to test the resulting service using the curl command. Finally, you'll learn how to use the kubectl command to manually scale up and down the deployment so that it can meet performance requirements.
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
- Use the kubectl command to create a custom namespace within the cluster
- Use the kubectl command to create a deployment
- Use the kubectl command to scale up and down the deployment
- 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)
Updates
October 25th, 2024 - Resolved an issue preventing the lab from provisioning successfully
August 14th, 2020 - Fixed issue preventing Kubernetes environment from starting