What Hooks Are and When They Fire
pre-install, post-upgrade, and the full event set.
What Hooks Are and When They Fire is a free Helm Academy lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Helm Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Why Hooks Exist
Sometimes you need work done at a precise moment in a release, like seeding a database. A Helm hook runs a resource at a chosen lifecycle event.
A Hook Is Just Annotated
A hook is an ordinary Kubernetes manifest with one extra annotation. The helm.sh/hook annotation tells Helm to treat it specially instead of as normal release content.
metadata:
annotations:
"helm.sh/hook": pre-installThe install Events
Two events fire around a fresh install. pre-install runs before any chart resources are created, and post-install runs after they are applied.
"helm.sh/hook": pre-installThe upgrade Events
Upgrades have their own pair. pre-upgrade fires before the upgrade is applied, and post-upgrade fires once the new resources are in place.
"helm.sh/hook": pre-upgrade,post-upgradeThe rollback Events
Rolling back to an earlier revision also triggers hooks. pre-rollback runs before the revert and post-rollback runs after the old state returns.
The delete Events
Uninstalling fires the delete pair. pre-delete runs before resources are removed, giving you a window to drain or back things up first.
"helm.sh/hook": pre-deleteThe test Event
One more event is special. The test hook does not fire on install; it runs only when you call helm test against an existing release.
"helm.sh/hook": testHooks Are Often Jobs
Most hooks are a Kubernetes Job, since a Job runs to completion and reports success. Helm waits for that Job before moving the release forward.
kind: Job
metadata:
annotations:
"helm.sh/hook": post-installHelm Waits for Success
For each weight, Helm waits until the hook resource reaches its ready state before continuing. A failed hook stops the whole install or upgrade.
Outside Normal Tracking
Hook resources live outside the release's normal lifecycle. They are not upgraded with the chart, so you manage their cleanup with separate delete policies.
Combine Several Events
One resource can serve more than one moment. List events together, like post-install,post-upgrade, so the same Job runs after both a fresh install and an upgrade.
"helm.sh/hook": post-install,post-upgradeQuick Check
You want a Job to run after a fresh chart is installed for the first time.
Recap
Hooks are annotated manifests that fire at lifecycle events: install, upgrade, rollback, delete, and test. Helm waits for each one to succeed. 🪝
Frequently asked questions
Is the “What Hooks Are and When They Fire” lesson free?
Yes — the full text of “What Hooks Are and When They Fire” is free to read here on the web, and the Helm Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Helm Academy course, upgrade to CoddyKit PRO.
What will I learn in “What Hooks Are and When They Fire”?
pre-install, post-upgrade, and the full event set. You practise Helm Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Helm Academy?
No prior experience is required. Helm Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “What Hooks Are and When They Fire” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Helm Academy lesson?
Yes. Every Helm Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- What Hooks Are and When They Fire
- A Database Migration pre-upgrade Job
- Hook Weights and Ordering
- Hook Deletion Policies