apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: xtrabackup-cronjob
spec:
  schedule: "*/1 * * * *"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: xtrabackup
            image: perconalab/backupjob-openshift
            command: ["bash","/usr/bin/backup.sh"]
            volumeMounts:
            - name: backup
              mountPath: /backup
            env:
            - name: NODE_NAME
              value: "pxc-node-2.pxc-nodes"
          restartPolicy: Never
          volumes:
          - name: backup
            persistentVolumeClaim:
              claimName: backup-volume
