---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: hibernation-cronjob
spec:
  # Time is measured in coordinated universal time (UTC)
  #          ┌───────────── minute (0 - 59)
  #          │ ┌───────────── hour (0 - 23)
  #          │ │  ┌───────────── day of the month (1 - 31)
  #          │ │  │ ┌───────────── month (1 - 12)
  #          │ │  │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday;
  schedule: "0 23 * * 0-6"
  jobTemplate:
    spec:
      template:
        spec:
          serviceAccountName: hibernator
          containers:
          - name: worker
            image: quay.io/jpacker/hibernation-curator:latest
            command: ['python','action.py']
            env:
            - name: TAKE_ACTION
              value: Hibernating
            - name: PYTHONWARNINGS
              value: "ignore:Unverified HTTPS request"  
          restartPolicy: OnFailure