Helm Versioning and Rollback: Safe Recovery

Learn how Helm revisions work, when to roll back, and how to choose a forward fix or data restore when Kubernetes changes affect a database.

published: reading time: 9 min read author: Geek Workbench updated: November 18, 2026
Quick Summary

A Helm rollback applies an earlier release revision and records a new one. It can restore Kubernetes manifests, but it cannot reverse database migrations, data changes, or external side effects. Check application and database compatibility before choosing rollback, a forward fix, or backup restoration.

Introduction

Helm records revisions of each release. A rollback asks Helm to apply the resources from an earlier revision and creates a new revision in the history. This can fix a bad image reference or configuration change. It does not rewind the rest of your system.

A database migration may already have run. A PersistentVolume may contain writes from the newer application. A hook may have called an external API. Helm cannot reverse those effects. Before rolling back, check whether the older chart and image can still work with the database schema and data that exist now.

Commands in this guide use Helm 4.3.1 unless a section says otherwise. Check the version installed in your deployment environment with helm version.

What Helm rollback changes

Suppose revision 5 was healthy, an upgrade created revision 6, and the upgrade then caused an application problem. helm rollback myapp 5 uses revision 5 as the target and applies its stored release configuration and resources. Helm records that action as another revision, such as revision 7. It does not change revision 6 or move the history counter backward. See the official helm rollback and helm history references.

Rollback is an operation on the Helm release. It is not a reverse diff of every change made during the deployment. Hook behavior, resource policies, cluster admission rules, and resources outside the release can affect the result. Treat the command as a request to restore a prior declared configuration, then inspect what actually happened.

Choose a recovery path

Start by listing what changed in the failed release: chart and values, application image, database schema or data, persistent storage, and any external systems touched by hooks or application code.

flowchart TD
    A[Deployment problem] --> B{Only Helm-managed config or image changed?}
    B -->|Yes| C{Will the old app work with current schema and data?}
    C -->|Yes| D[Roll back the Helm release]
    C -->|No or unknown| E[Forward-fix and test compatibility]
    B -->|No| F{Did data itself need to be reverted?}
    F -->|No| E
    F -->|Yes| G[Restore from a verified database backup]
    G --> H[Deploy an app version compatible with restored data]
Change observed First recovery choice Why
Wrong Deployment image or ConfigMap, with a database schema the old app still supports Roll back the release Helm can reapply the earlier image reference and configuration.
Additive schema change, and the old app has been tested against it Rollback may be viable Compatibility must be proven; the schema change remains in place.
Destructive migration or transformed data Forward-fix Helm does not reverse database work. Repair the application or migration while preserving valid writes.
PersistentVolume contents or external API effects changed Forward-fix or reconcile that system Reapplying Kubernetes manifests does not restore volume contents or undo external calls.
Data must return to a previous point in time Restore from a verified backup or point-in-time recovery Restore changes database state; Helm rollback alone does not. Test the restore process before an incident.

Do not roll back just because the previous chart revision was healthy before the upgrade. It is only a safe target if the previous application can read and write the current database state, and if any persistent or external changes have a separate recovery plan.

Check chart, image, and database compatibility

Record the relationship between the release revision, chart, image, and database schema before a migration. Replace the sample values below with the versions used by your service and verify them in staging.

Helm revision Chart and values Application image Database state after upgrade Rollback assessment
12 myapp 2.4.0, production values api@sha256:<digest-a> Schema 7 Candidate only if this image supports the live schema and data.
13 myapp 2.5.0, updated values api@sha256:<digest-b> Schema 8, additive column Candidate if the old image was tested against schema 8 and the migration left existing data valid.
14 myapp 2.6.0 api@sha256:<digest-c> Schema 9, old column removed and data converted Do not assume revision 12 or 13 can run. Forward-fix, or restore the database and deploy a matching application version.

A chart version does not identify every runtime dependency. Record immutable image digests where possible, migration identifiers, and whether the previous application supports the current schema. Keep this matrix with the release runbook; update it after a migration or image change.

A common way to keep rollback available is an expand-and-contract migration. First add a schema shape both old and new application versions can use. Deploy and verify the new version. Remove the old schema only in a later release, after the rollback window has passed. If that sequence does not fit the change, document a tested forward-fix or database restore plan before deployment.

Inspect and roll back a release

Use the release name, namespace, and target revision from the actual environment. Confirm that the revision is still in history, inspect its values and manifest, and check database compatibility before applying it.

RELEASE=myapp
NAMESPACE=production
TARGET_REVISION=5

# Inspect the current history and release state.
helm history "$RELEASE" --namespace "$NAMESPACE"
helm status "$RELEASE" --namespace "$NAMESPACE"

# Inspect the values and manifest stored for the target revision.
helm get values "$RELEASE" --namespace "$NAMESPACE" --revision "$TARGET_REVISION"
helm get manifest "$RELEASE" --namespace "$NAMESPACE" --revision "$TARGET_REVISION"

If the compatibility check supports a rollback, apply the selected revision and wait for Kubernetes resources to become ready:

helm rollback "$RELEASE" "$TARGET_REVISION" \
  --namespace "$NAMESPACE" \
  --wait \
  --timeout 5m

Then inspect the new history entry and workload state:

helm history "$RELEASE" --namespace "$NAMESPACE"
helm status "$RELEASE" --namespace "$NAMESPACE"
kubectl rollout status deployment/myapp --namespace "$NAMESPACE" --timeout=5m

A successful command is not enough. Confirm that Helm recorded a new revision targeting the intended version, the relevant pods are healthy, and the application can read and write the current data. Replace deployment/myapp with the workload name in your chart. If a hook fails or the cluster rejects a resource, investigate that error before trying a forced replacement.

Automatic handling of failed upgrades is version-specific

Helm has opt-in flags for reverting a failed upgrade. Their names and behavior depend on the Helm version. They attempt to restore the previous release when an upgrade fails; they do not roll back database migrations or external side effects, and the rollback itself can fail.

Helm version Upgrade option What it does
Helm 3 --atomic The Helm 3 upgrade documentation describes this as rolling back changes on upgrade failure and enabling --wait. See the Helm 3 upgrade reference.
Helm 4.3.1 --rollback-on-failure The current upgrade reference exposes this option to roll back to the last successful release on failure. See the Helm 4 upgrade reference.

These options are not universal guarantees. Use the flag supported by the deployed CLI, then test the failure path with the same hooks, permissions, resource types, and database migration behavior as production. A successful Helm-managed rollback does not prove that application data or external services returned to their previous state.

Release history storage and retention

Storage details are version-specific. The Helm 3 documentation says release information is stored in Kubernetes Secrets by default and describes configurable storage drivers, including ConfigMaps and SQL. That is a Helm 3 statement; check the documentation for the Helm version and storage driver you actually run before relying on it. The Helm 3 storage documentation also notes that release records can include chart and values data, so protect access to the configured backend.

A rollback also depends on the target revision still being available. Use helm history RELEASE --namespace NAMESPACE to confirm it exists. Set and monitor the release-history limit according to your rollback window; do not assume an old revision will remain available forever.

Common questions

Does Helm move the release back to the old revision number?

No. Helm applies the selected revision as the rollback target and records the rollback as a new revision. Check helm history after the command.

Can a Helm rollback undo a database migration?

No. It changes Helm-managed resources. Use a forward-fix for incompatible schema or data changes. Restore a database backup only when the data itself must return to an earlier point and the restore procedure has been verified.

Should every CI deployment use an automatic rollback flag?

Choose the flag documented for the deployed Helm version and test its failure behavior. Helm 3 documents --atomic; Helm 4.3.1 documents --rollback-on-failure. Neither option reverses database or external side effects.

Rollback checklist

Before running helm rollback:

  • Confirm the namespace, release, and target revision with helm history.
  • Compare the target chart, values, and image with the current release.
  • Check the migration history and verify the target application supports the live schema and data.
  • Identify PersistentVolume writes, hook actions, and external changes that Helm cannot reverse.
  • Choose rollback only for a compatible state; otherwise prepare a forward-fix or a tested database restore.

Afterward, check the new history entry, helm status, workload readiness, application logs, and database behavior. Record the result and update the compatibility matrix.

Further reading

Conclusion

A Helm rollback restores a prior release definition in the cluster and adds a new history entry. Your application still has to work with the database and data that exist after the upgrade. Check that compatibility first; then choose rollback, a forward-fix, or a verified data restore and confirm the result in both Helm history and the running workload.

Category

Related Posts

Developing Helm Charts: Templates, Values, and Testing

Create production-ready Helm charts with Go templates, custom value schemas, and testing using Helm unittest and ct.

#helm #kubernetes #devops

Helm Charts: Templating, Values, and Hooks

Build Helm charts with values, templates, dependencies, hooks, and schema validation. Examples target Helm v4.3.1 and focus on chart authoring.

#kubernetes #helm #devops

Container Security: Image Scanning and Vulnerability Risks

Implement comprehensive container security: from scanning images for vulnerabilities to runtime security monitoring and secrets protection.

#container-security #docker #kubernetes