apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: gitlab-backup
spec:
  schedule: "0 0 * * *"
  concurrencyPolicy: Forbid
  jobTemplate:
    spec:
      template:
        spec:
          restartPolicy: Never
          containers:
            - name: backup-exec
              image: apextoaster/kube:master
              args:
                - /bin/bash
                - -c
                - /scripts/gitlab-backup.sh
              volumeMounts:
                - name: cluster-scripts
                  mountPath: /scripts

          serviceAccountName: gitlab-backup
          volumes:
            # cluster scripts dir
            - name: cluster-scripts
              configMap:
                name: cluster-scripts
                defaultMode: 0755