X.J
X.J

Reputation: 523

Helm Hook not triggered

Context: Kubenete 1.0.3, Helm 2.8.2

Helm Hook: pre-install weight: 0 delete-policy: before-hook-creation

Helm command: helm upgrade --install -n namespace

Problem description: The hook block is well rendered when running with --dry-run mode. But after installing (without dry-run), no hook job is triggered.

Check the job using command kubectl get jobs -n namespace.

Upvotes: 2

Views: 3653

Answers (1)

PjoterS
PjoterS

Reputation: 14112

Hook is a mechanism introduced in HELM to intervence at certain points in release life cycle. Hooks can be definied in few ways via special annotations in metadata section, i.e. "pre-install", "post-install", "pre-upgrade" etc. Example of the hook:

apiVersion: ...
kind: ....
metadata:
  annotations:
    "helm.sh/hook": "pre-install"

Full list of Hooks can be found here. In addition there can be used more than one hook.

In this case "pre-upgrade" option resolved the issue which was
"Executes on an upgrade request after templates are rendered, but before any resources are loaded into Kubernetes (e.g. before a Kubernetes apply operation)."

Upvotes: -2

Related Questions