Interview Prep/Helm/Hooks, Tests & Validation

What are the hook delete policies?

IntermediateConceptHooks, Tests & Validation
Answer
  • before-hook-creation: delete the previous hook resource before creating the new one (the default when no policy is set).
  • hook-succeeded: delete after the hook succeeds.
  • hook-failed: delete if it fails.
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded

We always include before-hook-creation so the next run does not fail with jobs.batch "shop-migrate" already exists, and we usually omit hook-failed so failed Job pods stay around for kubectl logs.

All Helm questions Roadmap: Helm

More on Hooks, Tests & Validation