apiVersion: batch/v1
kind: Job
metadata:
  name: helm-hook-pre-job
  annotations:
    "helm.sh/hook": pre-install,pre-upgrade
    "helm.sh/hook-weight": "-5"
    "helm.sh/hook-delete-policy": before-hook-creation
spec:
  template:
    spec:
      containers:
      - name: cat-sleeper
        image: alpine
        env:
        - name: HELLO_WORLD
          valueFrom:
            configMapKeyRef:
                name: helm-hook-pre-cm
                key: helloWorld
        command: ["sh",  "-c", "echo $HELLO_WORLD ; sleep 180 ; echo done ;"]
      restartPolicy: Never
  backoffLimit: 0