Assume that today we'd like to scale our nginx Pods from two to four:
// kubectl scale --replicas=<expected_replica_num> deployment <deployment_name># kubectl scale --replicas=4 deployment my-nginxdeployment "my-nginx" scaled
Let's check how many pods we have now:
# kubectl get podsNAME READY STATUS RESTARTS AGEmy-nginx-6484b5fc4c-9v7dc 1/1 Running 0 1mmy-nginx-6484b5fc4c-krd7p 1/1 Running 0 1mmy-nginx-6484b5fc4c-nsvzt 0/1 ContainerCreating 0 2smy-nginx-6484b5fc4c-v68dr 1/1 Running 0 2s
We could find two more Pods are scheduled. One is already running and another one is creating. Eventually, we will have four Pods up and running if we have enough compute resources.