apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: update-bot-job
spec:
  schedule: "*/2 * * * *"     #change it to your schedule
  concurrencyPolicy: Replace
  jobTemplate:
    spec:
      template:
        spec:
          restartPolicy: OnFailure
          containers:
          - name: update-bot-container
            image: lasseurban/bot-update      #change it to your image
            imagePullPolicy: Always
            env:
              - name: CAI_CREDENTIALS_URL
                valueFrom:
                  secretKeyRef:
                    name: bot-secret
                    key: cai-credentials-url
              - name: CAI_CREDENTIALS_ID
                valueFrom:
                  secretKeyRef:
                    name: bot-secret
                    key: cai-credentials-id
              - name: CAI_CREDENTIALS_SECRET
                valueFrom:
                  secretKeyRef:
                    name: bot-secret
                    key: cai-credentials-secret
              - name: BOT_URL
                valueFrom:
                  secretKeyRef:
                    name: bot-secret
                    key: bot-url
              - name: X_TOKEN
                valueFrom:
                  secretKeyRef:
                    name: bot-secret
                    key: cai-x-token
              - name: STACK_URL
                valueFrom:
                  secretKeyRef:
                    name: bot-secret
                    key: stack-url
              - name: STACK_TAG
                valueFrom:
                  secretKeyRef:
                    name: bot-secret
                    key: stack-tag
              - name: STACK_KEY
                valueFrom:
                  secretKeyRef:
                    name: bot-secret
                    key: stack-key
              - name: DB_NAME
                valueFrom:
                  secretKeyRef:
                    name: bot-secret
                    key: db-name
              - name: DB_HOST
                valueFrom:
                  secretKeyRef:
                    name: bot-secret
                    key: db-host
              - name: DB_USER
                valueFrom:
                  secretKeyRef:
                    name: bot-secret
                    key: db-username
              - name: DB_PW
                valueFrom:
                  secretKeyRef:
                    name: bot-secret
                    key: db-password