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. There is no templates/pre-install-job.yaml in your lesson folder yet. Create it with this Job: press Play on the block and the file is made for you. Pressing Play again does not make a second copy. ...
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
