Go back to the previous revision
without losing data.
Roll back the update of a component when something goes wrong: through the Helm release history, or through Git when the component is an Argo CD Application. Also see what to protect first, because not every schema migration has a way back.
Rollback returns a component to the previous revision: in Helm, by choosing a revision from the release history. In Argo CD, by reverting in Git the commit that changed the version, because the cluster follows the repository. In both cases, the volume snapshot comes first.
Your environment
If you fill in your environment details here, examples and commands on the page use what you entered. REVISION is the revision number from helm history that you want to return to.
Back up the persistent data. Depending on the component, a rollback can cause data loss if the schema migrations of the new version are incompatible with the previous one. Scenario 1 shows how to create the volume snapshot.
Scenarios
- 1 · Protect the data
- 2 · Via Helm
- 3 · Via Argo CD
- 4 · A single component
- 5 · Diagnose before rolling back
Identify the component PVCs and create a snapshot of each one before rolling back.
An update went wrong and you are going to roll back. Before touching the release or Git, the component volumes need a snapshot: if the new version has already migrated the database schema, the previous version may not be able to read what was left, and the snapshot is the only way back for the data.
The release keeps the revision history. The rollback chooses one of them: scenario 2.
The cluster follows Git. The rollback is reverting the update commit and synchronizing: scenario 3.
The data snapshot and where the history lives
How was the component installed?
- PVC snapshot. A rollback can lose data if the schema migrations of the new version are not compatible with the previous one. The snapshot guarantees the way back. (
kubectl apply -f - <<EOF … kind: VolumeSnapshot … EOF) - Release revisions. Each install or upgrade creates a revision. The rollback returns the release to one of them, without needing the old chart or values. (
helm history <RELEASE_NAME> -n <NAMESPACE>) - Rollback. Creates a new revision with the content of the chosen revision. Without a number, it returns to the immediately previous one. (
helm rollback <RELEASE_NAME> <REVISION> -n <NAMESPACE>) - Verification. The last history entry is deployed, with the description Rollback to <REVISION>. (
helm status <RELEASE_NAME> -n <NAMESPACE>)
How was the component installed?: Via Helm
- PVC snapshot. A rollback can lose data if the schema migrations of the new version are not compatible with the previous one. The snapshot guarantees the way back. (
kubectl apply -f - <<EOF … kind: VolumeSnapshot … EOF) - Release revisions. Each install or upgrade creates a revision. The rollback returns the release to one of them, without needing the old chart or values. (
helm history <RELEASE_NAME> -n <NAMESPACE>) - Rollback. Creates a new revision with the content of the chosen revision. Without a number, it returns to the immediately previous one. (
helm rollback <RELEASE_NAME> <REVISION> -n <NAMESPACE>) - Verification. The last history entry is deployed, with the description Rollback to <REVISION>. (
helm status <RELEASE_NAME> -n <NAMESPACE>)
How was the component installed?: Via Argo CD
- PVC snapshot. A rollback can lose data if the schema migrations of the new version are not compatible with the previous one. The snapshot guarantees the way back. (
kubectl apply -f - <<EOF … kind: VolumeSnapshot … EOF) - git revert. The commit that changed the version is reverted in the repository. The cluster follows Git: nothing is changed directly in it. (
git revert <COMMIT_HASH> && git push origin main) - Synchronization. The kit Applications synchronize on their own when they detect the revert. With automated sync turned off, run argocd app sync. (
argocd app sync <APPLICATION_NAME>) - Verification. The Application returns to Synced and Healthy. (
argocd app get <APPLICATION_NAME>)
Identify the component PVCs
The list of volumes that the rollback can affect.
kubectl get pvc -n <NAMESPACE> -l app.kubernetes.io/instance=<RELEASE_NAME>
Create a snapshot of each volume
A consistent copy of each PVC, when the StorageClass supports snapshots.
kubectl get volumesnapshotclass
kubectl apply -f - <<EOF
apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshot
metadata:
name: <RELEASE_NAME>-pre-rollback-snapshot
namespace: <NAMESPACE>
spec:
volumeSnapshotClassName: <SNAPSHOT_CLASS>
source:
persistentVolumeClaimName: <PVC_NAME>
EOF
Repeat for each PVC listed in the previous step, changing name and persistentVolumeClaimName.
Confirm the snapshot is ready
No rollback until all snapshots are usable.
kubectl get volumesnapshot -n <NAMESPACE>
It worked when
READYTOUSE equal to true. Only then move on to scenario 2 or 3.If the cluster has no VolumeSnapshotClass
The StorageClass does not support snapshots.
Check the release history and return to a specific revision or to the previous one.
The component is a Helm release. Each helm install or helm upgrade creates a revision, and the rollback creates one more, with the content of the chosen revision: the chart and the values of that revision, without needing the old files.
helm history lists the revisions with date, status, chart, and description.
A specific revision, or the immediately previous one when the number is omitted.
A new revision, deployed, with the description Rollback to <REVISION>.
Check the revision history
The number of the revision to return to.
helm history <RELEASE_NAME> -n <NAMESPACE>
The output has the columns REVISION, UPDATED, STATUS, CHART, APP VERSION, and DESCRIPTION. Example for tdp-postgresql, installed once and upgraded three times with new values:
REVISION UPDATED STATUS CHART APP VERSION DESCRIPTION
1 Mon Jun 22 18:56:38 2026 superseded tdp-postgresql-<CHART_VERSION> <APP_VERSION> Install complete
2 Mon Jun 22 19:02:58 2026 superseded tdp-postgresql-<CHART_VERSION> <APP_VERSION> Upgrade complete
3 Mon Jun 22 19:14:23 2026 superseded tdp-postgresql-<CHART_VERSION> <APP_VERSION> Upgrade complete
4 Mon Jun 22 19:16:31 2026 deployed tdp-postgresql-<CHART_VERSION> <APP_VERSION> Upgrade complete
Return to the chosen revision
The release back to the chart and values of that revision.
# For a specific revision
helm rollback <RELEASE_NAME> <REVISION> -n <NAMESPACE>
# To the immediately previous one (no number)
helm rollback <RELEASE_NAME> -n <NAMESPACE>
In the example above, returning tdp-postgresql to revision 3:
helm rollback tdp-postgresql 3 -n <NAMESPACE>
Confirm the result
The release in deployed, in the new revision created by the rollback.
helm status <RELEASE_NAME> -n <NAMESPACE>
helm history <RELEASE_NAME> -n <NAMESPACE>
kubectl get pods -n <NAMESPACE> -l app.kubernetes.io/instance=<RELEASE_NAME>
It worked when
deployed with the description Rollback to <REVISION>, and the component pods return to Running.If the release stays in failed or pending-rollback
Check the reason with helm status and the namespace events, and repeat the rollback pointing to the revision before the one that failed.
Revert the commit in Git and let Argo CD synchronize the cluster.
The component is an Argo CD Application. The cluster follows the repository: the rollback is reverting in Git the commit that changed the version or the values, and letting Argo CD synchronize. In the Applications of the TDP GitOps kit, automated sync and selfHeal restore the manifest of each Application from Git, so reverting through Git is the only path that is not undone.
Automated sync, selfHeal, and prune. Revert through Git. The cluster follows on its own.
With automated sync turned off, revert through Git and run argocd app sync, or use argocd app rollback from the sync history.
Identify the update commit
The hash of the commit that changed the component version or values.
git log --oneline -10
Revert the commit and publish
The repository back to the state before the update.
git revert <COMMIT_HASH>
git push origin main
Argo CD detects the change and synchronizes the cluster, when automated sync is enabled.
Force the sync, if automated sync is turned offOpcional
The Application synchronized with the reverted repository.
argocd app sync <APPLICATION_NAME>
Argo CD also accepts returning the Application to an earlier revision of the sync history, without touching Git, but only when automated sync is disabled on the Application:
argocd app rollback <APPLICATION_NAME>
In the Applications of the TDP GitOps kit, automated sync is enabled and the App of Apps, with selfHeal, restores the manifest of each Application from Git. In this scenario, revert through Git, as in the previous step.
Confirm the state
The Application in Synced and Healthy on the previous version.
argocd app get <APPLICATION_NAME>
kubectl get pods -n <NAMESPACE> -l app.kubernetes.io/instance=<RELEASE_NAME>
It worked when
Synced and Healthy, and the component pods return to Running.If the Application stays OutOfSync after the revert
See the difference with argocd app diff <APPLICATION_NAME> and check that the push reached the branch the Application tracks. For the kit update and the sync symptoms, see Update via Argo CD.
After a general update, return only the component with the problem and check compatibility.
Several components were updated at once and only one has a problem. You can roll back just that one, as long as the version it returns to remains compatible with the new versions of the components it depends on, or that depend on it.
Identify the component with the problem
The release that needs to be rolled back.
kubectl get pods -n <NAMESPACE> --field-selector=status.phase!=Running
helm list -n <NAMESPACE> --failed
Roll back only that release
The component on the previous revision. The others stay updated.
helm rollback <RELEASE_NAME> -n <NAMESPACE>
On an installation via Argo CD, revert only the commit that changed that component, as in scenario 3.
Check compatibility with the others
The reverted component talking to the new versions of the others.
kubectl logs -n <NAMESPACE> -l app.kubernetes.io/instance=<RELEASE_NAME> --tail=50
kubectl get pods -n <NAMESPACE>
A partial rollback can cause incompatibility between components when there is a version dependency between them. See the version matrix before proceeding.
Pods in CrashLoopBackOff, migration error, connectivity, and a failed release: what to look at and when the rollback solves it.
The component misbehaves after the update, or helm status shows the release in failed or in a pending state, such as pending-rollback. Confirm the cause before deciding on the rollback and choosing the revision to return to.
Troubleshooting
Paste the message or choose the symptom.
- Pods in CrashLoopBackOff or Error after the update. Cause: The new version does not initialize. What to do: Read the pod description and the log of the previous run. If the cause is in the new version, return to the previous revision.
- Schema migration error in the component logs. Cause: The component logs show a database schema migration error after the update. What to do: Confirm in the logs. If the new version has already changed the database, restore the volume from the snapshot created in scenario 1, roll back the release, and check that the component initializes with the restored database.
- Components do not communicate after a partial update. Cause: Communication between the components failed after a partial update. What to do: Check whether the component Services have endpoints. If a component became incompatible with the version of another, roll back the affected components. The versions of each release are in the [version matrix](../../matriz-versoes.mdx).
- Release in failed or pending-rollback. Cause: helm status shows the release in failed or in a pending state. What to do: Check the status and the namespace events. Choose a revision from the history and return to it.
Best practices
- Keep Git consistent with the cluster state: on an installation via Argo CD, always revert through Git. Argo CD synchronizes the cluster with the repository.