Q: How do you roll back a Helm release?
bash
Want to master this scenario in a live sandbox? KodeKloud's CKA & CKAD Hands-On Certification Track covers this exact problem with hands-on terminal drills.
🛠️ Production Runbook & Step-by-Step Resolution
Direct Answer: To <strong>roll back a Helm release</strong>, run <code>helm history <release></code> to find a known-good revision, then <code>helm rollback <release> <revision></code>. Helm re-applies that revision's stored manifest and records the result as a brand-new revision, so history is never rewritten. Interviewers ask this to see whether you understand that Helm tracks releases as numbered Secrets in the release namespace, and that a rollback only restores what Helm manages: it does not undo database migrations, deleted PVC data or CRD changes.
Mental model: revisions behind a Helm rollback
Helm 3 stores every install and upgrade as a release Secret (type helm.sh/release.v1) containing the rendered chart, values and manifest.
- Revisions are immutable: a rollback to revision 3 from revision 5 creates revision 6 whose content equals revision 3.
- Default target: omitting the revision number rolls back to the immediately previous revision.
- Scope: only resources in the stored manifest are patched; anything created outside Helm is left alone.
- History limit: Helm keeps 10 revisions by default (
--history-max), so very old revisions may no longer exist.
Hands-on: helm history and rolling back a Helm release
Find the last good revision, compare what changed, then roll back and wait for readiness.
helm history my-app -n prod
# REVISION STATUS CHART DESCRIPTION
# 4 superseded my-app-1.3.0 Upgrade complete
# 5 deployed my-app-1.4.0 Upgrade complete
helm get values my-app -n prod --revision 4
helm rollback my-app 4 -n prod --dry-run
helm rollback my-app 4 -n prod --wait --timeout 5m --cleanup-on-fail
# Rollback was a success! Happy Helming!
- List revisions:
helm history my-app -n prodshows status (deployed,superseded,failed) per revision. - Compare values:
helm get values my-app -n prod --revision 3shows what was supplied then. - Roll back safely: add
--wait --timeout 5mso the command fails if pods never become ready. - Rehearse first:
--dry-runrenders the plan without touching the cluster.
Verify the rollback actually restored service
A success message from Helm only means the API accepted the manifests; confirm workload health separately.
helm status my-app -n prod | head -n 8
kubectl rollout status deploy/my-app -n prod --timeout=180s
kubectl get deploy my-app -n prod \
-o jsonpath='{.spec.template.spec.containers[0].image}{"\n"}'
- Release state:
helm status my-app -n prodshould showdeployedand a new highest revision. - Rollout:
kubectl rollout status deploy/my-app -n prodconfirms new ReplicaSet pods are Ready. - Image check: read the live image with
kubectl get deploy my-app -n prod -o jsonpath='{.spec.template.spec.containers[0].image}'. - Signals: check error rate and latency dashboards, not only pod status.
Failure modes: what helm rollback cannot undo
Most failed rollbacks come from state that lives outside the release manifest.
- Data and schema: database migrations and PVC contents are not reverted; an old app version may not start against a newer schema.
- CRDs: Helm installs CRDs from the
crds/directory once and never upgrades or rolls them back. - Hooks:
pre-rollbackandpost-rollbackhooks run, but upgrade hooks (such as migration Jobs) do not run in reverse. Use--no-hooksonly deliberately. - Stuck release: an interrupted operation leaves status
pending-upgradeand blocks further commands; roll back to the lastdeployedrevision to recover. - Immutable fields: changes to e.g. a Service
clusterIPor StatefulSet volumeClaimTemplates can make patching fail;--forcerecreates resources and causes downtime.
Production practice: make rollback automatic and auditable
Do not rely on someone remembering the revision number at 3 a.m.
helm upgrade --install my-app ./chart -n prod \
-f values-prod.yaml --atomic --wait --timeout 5m --history-max 15
- Auto-rollback on upgrade:
helm upgrade --install --atomic --wait --timeout 5mrolls back by itself if the upgrade fails. - Keep history: set
--history-max 10or higher so you have somewhere to go back to. - GitOps: with Argo CD or Flux the Git revert is the source of truth; a manual
helm rollbackwill be reverted by the next sync. - Audit: log
helm historyoutput in the pipeline for each deploy.
- A Helm rollback re-applies a stored earlier revision of a release and records it as a new revision, using <code>helm rollback <release> <revision></code>.
- I pick the target from <code>helm history</code>, compare values with <code>helm get values --revision</code>, and verify with <code>--wait</code> plus <code>kubectl rollout status</code>.
- I automate it with <code>--atomic</code> in CI and keep in mind CRDs, schema migrations and PVC data are not rolled back.
Senior hiring managers and bar raisers evaluate how you prioritize during outages. Avoid these common anti-patterns:
- Assuming rollback reverts database migrations Helm only restores Kubernetes manifests. A migration Job that ran on upgrade is not undone, so the old image may crash against the new schema.
- Rolling back without --wait The command returns once manifests are applied, so a broken revision can look successful while pods crash-loop.
- Expecting CRD changes to roll back Helm does not manage CRDs in the <code>crds/</code> folder after first install, so new CRD schemas stay in place.
- Running helm rollback on a GitOps-managed release Argo CD or Flux will sync back to the Git state and silently undo your rollback; revert the commit instead.