Introduction
In modern cloud-native applications, deployments happen frequently. Teams release new features, bug fixes, and updates regularly. However, not every deployment goes as planned. Sometimes, a new release introduces bugs, performance issues, or crashes.
This is where rollback in Kubernetes becomes extremely important.
Rollback allows you to safely return to a previous stable version of your application without downtime or major impact on users.
What is Rollback in Kubernetes?
Rollback in Kubernetes means reverting your application to a previous working version.
👉 Example:
Version 1 → Working fine
Version 2 → Bug introduced
👉 Rollback → Go back to Version 1
Kubernetes makes this easy using its built-in Deployment history feature.
Why Rollback is Important in Kubernetes
1. Quick Recovery from Failed Deployments
If a new deployment fails, rollback helps you recover instantly.
👉 This reduces downtime and protects user experience.
2. Safer Releases
Teams can deploy confidently knowing rollback is available.
3. Maintain Application Stability
Rollback ensures your system remains stable even after failed updates.
4. Essential for CI/CD Pipelines
Rollback is a key part of modern DevOps and Kubernetes CI/CD pipelines.
How Kubernetes Handles Deployment Versions
Kubernetes keeps track of deployment history using ReplicaSets.
👉 Each deployment creates a new ReplicaSet.
Old version → Old ReplicaSet
New version → New ReplicaSet
This allows Kubernetes to switch between versions easily.
Step-by-Step: Rollback Deployment in Kubernetes
Let’s understand how to rollback safely.
Step 1: Check Deployment Status
First, check your deployment status:
kubectl get deployments
👉 This shows all running deployments.
Step 2: View Deployment History
kubectl rollout history deployment <deployment-name>
👉 Example:
kubectl rollout history deployment my-app
Output
Revision 1
Revision 2
👉 Each revision represents a version.
Step 3: Inspect Specific Revision (Optional)
kubectl rollout history deployment my-app --revision=1
👉 Helps you understand what changed.
Step 4: Perform Rollback
To rollback to previous version:

Join the conversation! Your thoughts help the community grow.