Two hooks with the same weight run in an unexpected order. How does Helm decide?
IntermediateScenarioHooks, Migrations & Testing
Answer
Situation read → Same weight means Helm falls back to kind order, then name order.
What I'd do →
- Give explicit, distinct weights to anything with a dependency (
-10,-5,0,5). - Document weights in comments.
- Keep the number of hooks small; combine steps into one Job if they are always sequential.
Why → Relying on implicit tie-breaking is fragile.
Interview tip → Know the sort: weight, then kind, then name.
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?IntermediateHow do you clean up external resources (DNS records, S3 buckets) when a release is uninstalled?Advanced