How do you clean up external resources (DNS records, S3 buckets) when a release is uninstalled?
AdvancedScenarioHooks, Migrations & Testing
Answer
Situation read → Helm deletes Kubernetes objects only.
What I'd do →
- Prefer controllers that own lifecycle: external-dns removes records when the Ingress disappears; Crossplane/ACK delete cloud resources when their CRs are deleted.
- If unavoidable, a
pre-deleteJob that runs a cleanup script with scoped IAM. - Add
helm.sh/hook-delete-policy: hook-succeededand a timeout; document that a failed hook blocks uninstall (--no-hooksskips it).
Why → Controllers reconcile; one-shot hooks can fail and leak resources.
Interview tip → Prefer reconciliation over imperative hooks.
More on Hooks, Migrations & Testing
Design database migrations for a Helm-deployed app where the database is a subchart.IntermediateThe migration Job takes 12 minutes on prod data and the upgrade times out. What do you change?IntermediateA migration hook failed and the Job pod was deleted, so you cannot see why. How do you fix the chart?BeginnerYou want a backup before every production upgrade. How do you do it with Helm?IntermediateA `post-install` hook seeds demo data; it ran again on every upgrade and duplicated rows. Why?IntermediateWhat would you put in `helm test` for a 3-tier app?Intermediate