Mastering Helm from Scratch: Part 7 - Helm Hooks - Managing Chart Lifecycle Events
Automating and Controlling Chart Lifecycle Events with Helm Hooks
Welcome to the final part of Mastering Helm from Scratch! In this chapter, we’ll dive into Helm hooks, a powerful feature that enables you to automate and manage chart lifecycle events. Helm hooks give you control over specific actions that can be triggered before or after critical stages, such as installation, upgrade, or deletion of a release.
In this final part, you’ll understand what Helm hooks are. I'll also guide you through creating a practical example of a Helm hook to demonstrate how to trigger actions at different points in the deployment or upgrade process.
Helm Hook Types
Helm provides several hook types that correspond to specific events in the release lifecycle. Here are some of the most commonly used hook types:
pre-install: Runs before the installation of a chart.
post-install: Runs after the installation of a chart.
pre-upgrade: Runs before upgrading a chart.
post-upgrade: Runs after upgrading a chart.
pre-delete: Runs before deleting a chart.
post-delete: Runs after deleting a chart.
test: Runs tests defined in the chart.
Each hook is defined in a Kubernetes manifest file within the chart's templates/
directory, with an annotation that specifies the hook type.
Keep reading with a 7-day free trial
Subscribe to Curious Devs Corner to keep reading this post and get 7 days of free access to the full post archives.