A Database Migration pre-upgrade Job
Annotating a Job to run before the rollout.
A Real Use Case
Before new app code rolls out, your database schema often needs migrating. A pre-upgrade hook is the perfect spot to run that migration safely.
Why Before the Rollout
Running it as pre-upgrade means the schema is ready before the new pods start. The fresh code never talks to an old, mismatched database.
"helm.sh/hook": pre-upgradeAll lessons in this course
- What Hooks Are and When They Fire
- A Database Migration pre-upgrade Job
- Hook Weights and Ordering
- Hook Deletion Policies