What are Helm hooks and give an example.
BeginnerScenarioHelm, operators and GitOps
Answer
Situation read → A DB migration must run before upgrade.
What I'd do →
- Add annotation
"helm.sh/hook": pre-upgradeto a Job - Add
"helm.sh/hook-delete-policy": before-hook-creation - Set weights for ordering
- Watch the hook with
kubectl get jobs - Remember hooks are not part of the release manifest
Why → Hooks run at lifecycle points like pre-install and post-upgrade.
Interview tip → Mention test hooks with helm test.
More on Helm, operators and GitOps
A `helm upgrade` failed halfway. How do you see state and recover?BeginnerHelm says `cannot re-use a name that is still in use` or `another operation is in progress`. What now?IntermediateHow do you review what a Helm upgrade will change before running it?IntermediateWhere do you keep chart values for multiple environments?BeginnerWhat does `helm template` do and how is it different from `helm install`?BeginnerA Helm chart upgrade changed an immutable field and failed. How do you proceed?Advanced