apiVersion: batch/v1
kind: CronJob
metadata:
  name: "cron-{{name}}"
spec:
  concurrencyPolicy: Forbid
  schedule: "{{schedule}}"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: "cron-{{name}}"
            image: "image-registry.openshift-image-registry.svc:5000/koschei/koschei:latest"
            command: ["/bin/bash", "-euxc", "{{command}}"]
            env:
              - name: SUDO_USER
                value: "cron-{{name}}"
            volumeMounts:
              - name: config
                mountPath: /etc/koschei
                readOnly: true
          restartPolicy: Never
          volumes:
            - name: config
              secret:
                secretName: backend-config
