When you update a Deployment, or plan to, you can pause rollouts for that Deployment before you trigger
one or more updates. When you're ready to apply those changes, you resume rollouts for the Deployment.
This approach allows you to apply multiple fixes in between pausing and resuming without triggering
unnecessary rollouts
1. Get the Deployment details:
kubectl get deploy
2. Pause by running the following command:
kubectl rollout pause deployment/ubuntu-deployment
3. Then update the image of the Deployment:
kubectl set image deployment.v1.apps/ubuntu-deployment ubuntu=ubuntu:16.04
4. Notice that no new rollout started:
kubectl rollout history deployment/ubuntu-deployment
5. Get the rollout status to verify that the existing ReplicaSet has not changed: kubectl get rs
6. You can make as many updates as you wish, for example, update the resources that will be used:
kubectl set resources deployment/ubuntu-deployment -c=ubuntu--limits=cpu=200m,memory=512Mi
Eventually, resume the Deployment rollout and observe a new ReplicaSet coming up with all the new
updates:
7.
kubectl rollout resume deployment/ubuntu-deployment
8. Watch the status of the rollout until it's done.
kubectl get rs -w