Interview Prep/Helm/Hooks, Migrations & Testing

A migration hook failed and the Job pod was deleted, so you cannot see why. How do you fix the chart?

BeginnerScenarioHooks, Migrations & Testing
Answer

Situation read → hook-delete-policy included hook-failed, or the Job had ttlSecondsAfterFinished too low.

What I'd do →

  1. Use before-hook-creation,hook-succeeded (no hook-failed) so failed Jobs remain.
  2. Ship hook logs to the central logging stack so they survive deletion.
  3. In CI, on failure, run kubectl logs job/shop-migrate -n shop --all-containers before anything else.

Why → Failed hooks are the ones you need to inspect.

Interview tip → Know the three delete policies and which to omit.

All Helm questions Roadmap: Helm

More on Hooks, Migrations & Testing