apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: pixies-database-backup
spec:
  schedule: "00 18 * * *"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: pixies-database-backup
            image: fcambria/pixies:latest
            imagePullPolicy: Always
            args:
            - /opt/pixies/backup-plan.sh
            env:
              - name: DB_HOST
                value: ""
              - name: DB_USER
                valueFrom:
                   secretKeyRef:
                     name: pixies-secrets
                     key: DB_USER
              - name: DB_PASSWORD
                valueFrom:
                   secretKeyRef:
                     name: pixies-secrets
                     key: DB_PASSWORD
              - name: AWS_ACCESS_KEY_ID
                valueFrom:
                   secretKeyRef:
                     name: pixies-secrets
                     key: AWS_ACCESS_KEY_ID
              - name: AWS_SECRET_ACCESS_KEY
                valueFrom:
                   secretKeyRef:
                     name: pixies-secrets
                     key: AWS_SECRET_ACCESS_KEY
              - name: BUCKET_NAME
                value: ""
              - name: TARGET_HOSTNAME
                value: ""
          restartPolicy: Never
