Helm Rollback Strategies
What you'll learn: How to use helm rollback to safely revert deployments and manage revision history when things go wrong.
Understanding Helm Rollback
Every time you install or upgrade a Helm release, Helm creates a revision—a snapshot of that deployment. Think of revisions like save points in a video game: if your current state isn't working, you can jump back to a previous good state. The helm rollback command lets you return to any earlier revision when a deployment fails or behaves unexpectedly.
How Rollback Works
When you run helm rollback <release-name> <revision>, Helm retrieves the configuration from that specific revision and reapplies it. If you omit the revision number, Helm rolls back to the immediately previous revision by default.
# Rollback to previous revision
helm rollback my-app
# Rollback to specific revision (e.g., revision 3)
helm rollback my-app 3
Managing Revision History
You can inspect your release history to decide which revision to target:
helm history my-app
This shows all revisions with their deployment status, chart version, and description. Use this information to identify the last known-good state.
Rollback Strategies
- Immediate rollback: When a deployment fails health checks, rollback quickly to restore service
- Targeted rollback: Use revision numbers to skip bad intermediate versions
- Limit history depth: Configure
--history-maxto prevent unbounded revision storage
Cleanup Consideration
By default, Helm retains all revision history. You can limit this with --history-max during install or upgrade to prevent storage bloat in your cluster.
Key Takeaway: helm rollback provides a safety net for deployments by leveraging Helm's revision history, allowing you to quickly revert to previous working states using revision numbers or defaulting to the last deployment.