---
apiVersion: batch/v1
kind: CronJob
metadata:
  name: pod-terminator
spec:
  schedule: "5 4 * * *" # “At 04:05.” https://crontab.guru/every-24-hours 
  jobTemplate:
    spec:
      template:
        spec:
          serviceAccountName: pod-terminator
          containers:
          - name: pod-terminator
            image: quay.io/devfile/universal-developer-image:ubi8-latest
            command:
            - /bin/sh
            - -c
            - kubectl delete pods -l app=che -n dogfooding
          restartPolicy: OnFailure
