apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: project-test
spec:
  schedule: "0 0 * * *"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: project-test
            image: davidgasquez/dbt-project-test:1.0.0
            env:
              - name: REDSHIFT_DB_NAME
                valueFrom:
                  secretKeyRef:
                    name: redshift
                    key: database
              - name: REDSHIFT_USER
                valueFrom:
                  secretKeyRef:
                    name: redshift
                    key: user
              - name: REDSHIFT_ENDPOINT
                valueFrom:
                  secretKeyRef:
                    name: redshift
                    key: endpoint
              - name: REDSHIFT_PASSWORD
                valueFrom:
                  secretKeyRef:
                    name: redshift
                    key: password
              - name: REDSHIFT_DB_PORT
                valueFrom:
                  secretKeyRef:
                    name: redshift
                    key: port
            imagePullPolicy: Always
          restartPolicy: OnFailure
