Hooks and Tests
Part of the Helm course
Some work does not fit neatly into "render a manifest and apply it." A database schema needs to be migrated before the new application pods start reading from it, or an admin account needs to exist right after a fresh install finishes, or you want an automatic smoke test that pokes the service and confirms it actually answers before you walk away from a deploy.
There is no kind: Hook anywhere in Kubernetes or in Helm. A hook is an ordinary Kubernetes resource, most often a Job or a Pod, that carries a particular annotation Helm watches for. Here is one from this lesson's workspace, templates/pre-install-job.yaml:
Want to learn Helm Hooks and Tests in a real environment?
Click below, get a fresh Linux box with Helm ready to go, and work through Hooks and Tests hands-on with an AI tutor that knows your code.
Start this lessonHooks and TestsWhat you'll learn
- Helm.sh/hook annotation
- Pre-install
- Post-install
- Pre-upgrade
- Hook-delete-policy
- Helm test
- Test pod pattern
- When hooks are evil
