Scaling applications
When our application becomes popular, in order to handle increasingly on-demand requests, we need to spin up multiple instances of applications to satisfy the workload requirements.
When you have a Deployment, scaling is achieved by changing the number of replicas. Here, you can scale a Deployment using the kubectl scale
command to make this happen:
kubectl scale deployment kubeserve --replicas=6
Your output should look as follows:
deployment.apps/kubeserve scaled
If you use the kubectl get pods
command now, you will see that some more copies of the pods are spinning up, as shown in the following output:
Figure 4.17 – kubectl getting the pods and showing more copies of them
Aside from manually scaling the Deployments with the kubectl scale
command, we also have another way of scaling a Deployment and its ReplicaSets, which is HorizontalPodAutoscaler (HPA). Let’s take a look at the ReplicaSets first.