This article covers the process of monitoring deployment rollouts, updating container images, and performing rollbacks using Kubernetes commands.
Understanding Rollouts and Versioning
When you create a deployment, Kubernetes initiates a rollout that establishes the first deployment revision (revision one). Later, when you update your application—say by changing the container image version—Kubernetes triggers another rollout, creating a new revision (revision two). These revisions help you track changes and enable rollbacks to previous versions if issues arise.
Deployment Strategies
There are different strategies to update your applications. For example, consider a scenario where your web application is running five replicas. One approach is the “recreate” strategy, which involves shutting down all existing instances before deploying new ones. However, this method results in temporary downtime as the application becomes inaccessible during the update.

Updating a Deployment
There are several methods to update your deployment, such as adjusting the container image version, modifying labels, or changing the replica count. A common practice is to update your deployment definition file and then apply the changes. For example, consider the following deployment definition:Remember, using
kubectl set image updates the running deployment but does not modify your deployment definition file. Ensure you update the file as well for future reference.Viewing Deployment Details
To retrieve detailed information about your deployment—including rollout strategy, scaling events, and more—use:- Recreate Strategy: Events indicate that the old ReplicaSet is scaled down to zero before scaling up the new ReplicaSet.
- Rolling Update Strategy: The old ReplicaSet is gradually scaled down while the new ReplicaSet scales up.
Upgrading and Rolling Back
During an upgrade, Kubernetes creates a new ReplicaSet for the updated containers while the original ReplicaSet continues to run the old version. This rolling update process ensures that new pods replace the old ones gradually without causing downtime.
Summary of Commands
Below is a quick reference table of the key commands discussed in this article:
With these commands and strategies, you can manage your Kubernetes deployments confidently, ensuring minimal downtime and a reliable process for both updates and rollbacks.
For additional information, see the Kubernetes Documentation.