k8wiz
Helm
Hard
Concepts

A chart has a pre-upgrade Job hook with no helm.sh/hook-delete-policy annotation. What happens to the Job left from the previous upgrade when the hook runs again?

Select your answer:

Show answer and explanation

Answer: Helm deletes it just before creating the new Job

Explanation

Hook resources aren't tracked as part of the release, so they stay in the cluster after they run. When no delete policy is set, Helm applies before-hook-creation, which removes the previous resource just before creating the new one. Use hook-succeeded or hook-failed to clean up right after the hook finishes.