In this chapter, you will use a couple of methods to scale the number of Pod replicas, in a Deployment, up and down.
The methods you’ll use are manual and require a human to implement them. Kubernetes has a separate object, called a Horizontal Pod Autoscaler (HPA), for automatic scaling. However, that is beyond the scope of a quick-start course like this.
The chapter is split into three parts:
Prerequisites
Manual scale-up
Manual scale-down
Prerequisites
If you have been following along, you should have a Kubernetes cluster running 5 replicas of an application that you containerized. If so, you can skip to the scale an application up component.
Remember to copy and paste the LKE cluster kubeconfig to the config file and configure the kubectl command if you have not done this already.
If you have not been following along, run the following command to deploy 5 replicas of the containerized application to your cluster. Be sure to run the command from within the directory containing the deploy.yml file.
$ kubectl apply -f deploy.yml
deployment.apps/qsk-deploy created
Run a kubectl get deployments command to make sure that the application is running.
$ kubectl get deployments
NAME READY UP-TO-DATE AVAILABLE AGE
qsk-deploy 5/5 5 5 4m
As soon as all 5 replicas are up and running, you can move to the next component.