Course contentsShow
← Docker, Kubernetes & CI/CD
Lesson 278 of 8024. Kubernetes Architecture and Core ObjectsFree lesson

Pausing and Resuming Deployment Rollouts

Implement techniques to pause an active deployment update, allowing for manual verification before resuming the rollout process.

In this lesson, you will learn how to manually halt a rolling update to perform safety checks before letting Kubernetes complete the deployment.

Why Pause a Deployment?

By default, when you update a Deployment image, Kubernetes automatically replaces old Pods with new ones. While this is great for speed, sometimes you want to perform a "canary" check. You might want to update a few Pods, pause the process, verify that your application is behaving correctly in the live environment, and only then proceed to roll out the update to the rest of the fleet.

Implementing the Pause/Resume Workflow

You can control this lifecycle using the kubectl rollout command.

To pause an active rollout, run:

kubectl rollout pause deployment/my-app

Once paused, any updates you make to the Deployment configuration (like changing an image version) will be "held." Kubernetes will update the Deployment object, but it will not trigger the creation of new Pods or the termination of old ones. This gives you a window of time to inspect your infrastructure.

Once you have verified that your environment is ready, you can unblock the process by running:

kubectl rollout resume deployment/my-app

Watching the Progress

After you resume the rollout, you can continue to track the transition using the command you learned previously:

kubectl rollout status deployment/my-app

This pattern is incredibly powerful because it acts as a manual "circuit breaker." If you discover an issue during the pause period, you can either fix the configuration or initiate a rollback to the previous version before the faulty update affects your entire cluster. It transforms an automated deployment into a controlled, verified release process.

Key Takeaway: The kubectl rollout pause and resume commands provide an essential manual gate that allows you to safely verify new versions before they are fully propagated across your cluster.