9. Scaling Pods
9.1. Overview
The section provides guidelines on the scaling of pod resource. Cart microservice will be used in this tutorial.
9.2. Scaling Up Pods
There are two ways to scale up the pods.
9.2.1. Using CLI
9.2.1.1. Get the Cart microservice pods
kubectl get pods -n NAMESPACE_NAME | grep cart
1
Currently, it has only 1 pod.
9.2.1.2. Pods can be scaled by changing the replica-count in the
kubectl scale --replicas=2 deployment cart -n NAMESPACE_NAME
1
9.2.1.3. Get the Cart microservice pods
kubectl get pods -n NAMESPACE_NAME | grep cart
1
Now it will have 2 pods
9.2.2. Using Dashboard
9.2.2.1. It can be seen that Cart microservice has only 1 pod
9.2.2.2. Edit the replica count
9.2.2.3. Increase the replica count
9.2.2.4. It can be seen that Cart microservice has 2 pod
9.3. Scaling Down Pods
There are two ways to scale down the pods.
9.3.1. Using CLI
9.3.1.1. Get the Cart microservice pods
kubectl get pods -n NAMESPACE_NAME | grep cart
1
Currently, it has only 2 pods.
9.3.1.2. Pods can be scaled by changing the replica-count in the
kubectl scale --replicas=1 deployment cart -n NAMESPACE_NAME
1
9.3.1.3. Get the Cart microservice pods
kubectl get pods -n NAMESPACE_NAME | grep cart
1
Now it will have 1 pod
9.3.2. Using Dashboard