apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: refresh-data
  labels:
    app: CIRCLE_SHA1

spec:

  schedule: "0 */2 * * *"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
            - name: db-refresher
              image: IMAGE_NAME_DB_REFRESHER
              imagePullPolicy: IfNotPresent
              env:
                - name: DB_HOST
                  valueFrom:
                    secretKeyRef:
                      name: vakyansh-secret
                      key: DB_HOST
                - name: DB_NAME
                  valueFrom:
                    secretKeyRef:
                      name: vakyansh-secret
                      key: DB_NAME
                - name: DB_USER
                  valueFrom:
                    secretKeyRef:
                      name: vakyansh-secret
                      key: DB_USER
                - name: DB_PASS
                  valueFrom:
                    secretKeyRef:
                      name: vakyansh-secret
                      key: DB_PASS
                - name: BUCKET_NAME
                  valueFrom:
                    secretKeyRef:
                      name: vakyansh-secret
                      key: STATIC_BUCKET_NAME
                - name: ENCRYPTION_KEY
                  valueFrom:
                    secretKeyRef:
                      name: vakyansh-secret
                      key: ENCRYPTION_KEY
                - name: AWS_ACCESS_KEY_ID
                  valueFrom:
                    secretKeyRef:
                      name: vakyansh-secret
                      key: AWS_ACCESS_KEY_ID
                - name: AWS_SECRET_ACCESS_KEY
                  valueFrom:
                    secretKeyRef:
                      name: vakyansh-secret
                      key: AWS_SECRET_ACCESS_KEY
                - name: region
                  valueFrom:
                    secretKeyRef:
                      name: vakyansh-secret
                      key: region
          restartPolicy: OnFailure
