I am having a small shell script . it has the following snippet of code
kubectl scale deployment sample1 --replicas=0 -n sb1
kubectl scale deployment sample1 --replicas-3 -n sb1
The first command is scale down my deployment and the second command is to scale up . is there any flags /conditions (wait --for=condition=complete) that I can use to ensure the deployment is scaled down and scaled up ?
There is no wait for completion flag in
kubectl scale --help.
You may run the following to check if the replica rollout is completed:Example:
After scaling check the rollout status, the rollout status will block until the rollout to desired replica count is available: