Rolling Updates & Rollback
Ship a new version with zero downtime, then recover instantly when one goes wrong. Scale a running app, perform a rolling update to a new image, and roll it back to the previous version with one command.
- Advanced
- 45 min
- Kubernetes
- Rollouts
- kubectl
- DevOps
Overview
The reason teams trust Kubernetes with production is how it handles change. A rolling update replaces pods a few at a time so the app never fully goes down, and if the new version misbehaves, a rollback restores the previous one in seconds — because Kubernetes keeps the revision history.
You start with a running deployment (web, on an older nginx). You'll scale it for resilience, roll out a newer image version and watch the pods cycle, then roll back to the previous revision and confirm the image reverted. This is the safety net that makes frequent, confident deploys possible.
What you will learn
- Scale a Deployment for resilience during updates
- Perform a rolling update by changing a Deployment's image
- Watch a rollout replace pods incrementally
- Roll back to the previous revision with
kubectl rollout undo - Verify the running image after each change
Before you start
- Deploy, Expose & Scale an App first, or equivalent kubectl basics
- You know what a Deployment and a Pod are
Tasks
- 01Scale up before you ship
- 02Roll out a new version
- 03Roll back instantly