apiVersion: batch/v1
kind: Job
metadata:
  generateName: autoapply-
spec:
  template:
    spec:
      restartPolicy: Never
      containers:
        - name: autoapply
          image: registry.hubbe.club/autoapply:latest
          command: ["bash"]
          args: ["/apply.sh"]
          env:
            - name: SOPS_AGE_KEY_FILE
              value: /keys.txt
          volumeMounts:
            - mountPath: /apply.sh
              name: apply-script
              subPath: apply.sh
            - mountPath: /keys.txt
              name: age-keys
              subPath: keys.txt
      volumes:
        - name: apply-script
          configMap:
            name: apply-script
            defaultMode: 0755
        - name: age-keys
          secret:
            secretName: age-keys
