apiVersion: batch/v1
kind: CronJob
metadata:
  name: delete-pvcs
spec:
  # https://crontab.guru
  # Once every hour (at minute 0)
  schedule: "0 * * * *"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
            - name: delete-pvcs
              image: quay.io/packit/delete-pvcs
              imagePullPolicy: IfNotPresent
              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: SANDBOX_NAMESPACE
                #   value: different-sandbox
                - name: TOKEN
                  valueFrom:
                    secretKeyRef:
                      name: pvcdeleter-token-spqmw
                      # PROD
                      # name: pvcdeleter-token-fjgcz
                      key: token
              resources:
                limits:
                  memory: "80Mi"
                  cpu: "100m"
          restartPolicy: OnFailure
