---
apiVersion: batch/v1
kind: Job
metadata:
  annotations:
    helm.sh/hook: pre-install
    helm.sh/hook-weight: "1"
  name: airm-secret-generator
  namespace: airm
spec:
  backoffLimit: 3
  template:
    spec:
      containers:
        - command:
            - /bin/bash
            - -c
            - /scripts/generate-secrets.sh
          image: ghcr.io/silogen/cluster-tool:latest
          imagePullPolicy: IfNotPresent
          name: secret-generator
          volumeMounts:
            - mountPath: /scripts
              name: script-volume
      restartPolicy: OnFailure
      serviceAccountName: airm-secret-generator-sa
      volumes:
        - configMap:
            defaultMode: 493
            name: airm-secret-generator-script
          name: script-volume
