apiVersion: batch/v1
kind: Job
metadata:
  name: cloudforms-backup
spec:
  template:
    metadata:
      name: cloudforms-backup
    spec:
      containers:
      - name: postgresql
        image: brew-pulp-docker01.web.prod.ext.phx2.redhat.com:8888/cloudforms46/cfme-openshift-postgresql:latest
        command:
        - "/opt/rh/cfme-container-scripts/backup_db"
        env:
        - name: DATABASE_URL
          valueFrom:
            secretKeyRef:
              name: cloudforms-secrets
              key: database-url
        volumeMounts:
        - name: cfme-backup-vol
          mountPath: "/backups"
      volumes:
      - name: cfme-backup-vol
        persistentVolumeClaim:
          claimName: cloudforms-backup
      restartPolicy: Never
