apiVersion: batch/v1
kind: Job
metadata:
  name: rev4-db-deploy
spec:
  ttlSecondsAfterFinished: 60
  template:
    spec:
      restartPolicy: "OnFailure"
      containers:
      - name: rev-db-deploy
        image: okliukin/rev4-db-deploy:1.0
        env:
        - name: PGHOST
          value: rev4-pg
        - name: PGDATABASE
          value: rev4
        - name: PGUSER
          valueFrom:
            secretKeyRef:
              name: rev4.rev4-pg.credentials
              key: username
        - name: PGPASSWORD
          valueFrom:
            secretKeyRef:
              name: rev4.rev4-pg.credentials
              key: password
