Skip to content

Lesson 3 of 9 · 23m

Release Operations: Upgrades, Hooks, and Rollback Reality

How Helm tracks releases, where hooks fit, why rollback is narrower than people assume, and how to design upgrade paths that can be rehearsed.

Helm's release history is a convenience, not a disaster recovery plan. I have seen teams run helm rollback after a failed migration and discover the Deployment went back while the database schema did not. The application then failed harder, but this time during an incident bridge. Rollback is a deployment mechanism, not a time machine.

Understand the release record

helm list -n payments
helm history payments -n payments
helm get values payments -n payments
helm get manifest payments -n payments

The release record contains the chart version, applied values, rendered manifest, revision number, and status. This is invaluable when production behavior does not match what Git says should be deployed. Comparing helm get manifest with helm template answers "what is actually installed?" before "what do we think should be installed?"

Hooks are exceptions, not architecture

Helm hooks run Jobs or other resources at lifecycle points such as pre-upgrade and post-upgrade. They are useful for migrations, cache warm-up, and smoke tests:

metadata:
  annotations:
    "helm.sh/hook": pre-upgrade
    "helm.sh/hook-weight": "-5"
    "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded

The danger is hidden ordering and hidden state. A migration Job that must run before application rollout is acceptable if it is idempotent, observable, and has a bounded timeout. A graph of ten hooks orchestrating an entire deployment procedure is a bespoke workflow engine with worse tooling.

Design for roll-forward first

Production teams usually roll forward because rolling back reintroduces known-bad state. Design upgrades so the new version can tolerate the old schema briefly, then migrate, then remove old behavior later. For Helm specifically:

  1. Keep chart version, app version, and image tag distinct.
  2. Make destructive toggles explicit (migration.enabled, cleanupLegacyResources).
  3. Use --atomic carefully; it rolls back on failure but increases change coupling.
  4. Rehearse upgrades against a snapshot-like environment, not just a fresh empty namespace.

Field notes

  • helm uninstall does not delete PVCs created by StatefulSets. That is often correct and always surprising.
  • Helm ownership conflicts happen when manifests are edited by another controller or copied between charts. Fix ownership deliberately rather than layering --force everywhere.
  • --wait waits for readiness, not correctness. A bad migration can still leave a "successful" release.
  • Keep hook Jobs visible in GitOps diffs; hidden imperative steps erode the whole delivery model.

Was this lesson helpful?

Sign in to rate