concept

Hooks tests and CRDs

A hook is a templated resource with a lifecycle annotation. pre-upgrade runs before ordinary upgrade resources are updated. The example Job only prints a fixed message; it does not migrate a database. A lower hook weight runs before a higher one in the same event. A failing Job hook can fail the release operation. Use deadlines, bounded retries and least privilege; a migration should be idempotent and compatible with the old and new application versions.

Formal Syntax & Structure

kubernetes syntaxkubernetes
helm test RELEASE

Working Example

Example Snippetkubernetes
annotations:  "helm.sh/hook": test  "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
Kubernetes Reference