What are Helm hooks?
BeginnerConceptHooks, Tests & Validation
Answer
Hooks are normal manifests (usually Jobs) annotated with helm.sh/hook that Helm runs at specific points in the release lifecycle instead of applying them with the rest of the chart. Typical uses: database migrations before an upgrade, backups before uninstall, cache warmup after install, smoke tests.
metadata:
annotations:
"helm.sh/hook": pre-upgrade
"helm.sh/hook-weight": "0"
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
More on Hooks, Tests & Validation
List all hook types and when they run.BeginnerHow do hook weights work?IntermediateWhat are the hook delete policies?IntermediateAre hook resources part of the release? What happens on uninstall?IntermediateHow does Helm decide a hook is "done"?AdvancedWhy is running a migration as a `pre-install` hook often a mistake?Advanced