Hooks and jobs

Basic example on running jobs using hooks.

Introduction

Jobs only have some mutable fields making them tricky to patch/update this problem can be solved by using hooks.

In the following example we’ve marked a Job to be ran after the deployment, we’ve also specified kluctl not to wait for its completion.

apiVersion: batch/v1
kind: Job
metadata:
  name: pi
  annotations:
    kluctl.io/hook: post-deploy
    kluctl.io/hook-wait: false
spec:
  template:
    spec:
      containers:
      - name: pi
        image: perl:5.34.0
        command: ["perl",  "-Mbignum=bpi", "-wle", "print bpi(2000)"]
      restartPolicy: Never
  backoffLimit: 4
Last modified December 4, 2025: Fix markdown link (6ced62e)