apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: import-images
spec:
  # https://crontab.guru
  # STG: Once every hour (at minute 0)
  schedule: "0 * * * *"
  # PROD: At 02:00 on Monday
  # schedule: "0 2 * * 1"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
            - name: import-images
              image: usercont/import-images
              env:
                - name: KUBECONFIG
                  value: /tmp/.kube/config
                - name: HOST
                  value: https://api.pro-eu-west-1.openshift.com
                - name: DEPLOYMENT
                  value: stg
                  # PROD
                  # value: prod
                - name: TOKEN
                  valueFrom:
                    secretKeyRef:
                      name: importimager-token-cbw75
                      # PROD
                      # name: importimager-token-gl9g9
                      key: token
              resources:
                requests:
                  memory: "64Mi"
                  cpu: "100m"
                limits:
                  memory: "128Mi"
                  cpu: "100m"
          restartPolicy: OnFailure
