---
kind: CronJob
apiVersion: batch/v1beta1
metadata:
  name: cleaner
  namespace: gitlab-ci-kubernetes-namespace-cleaner
  labels:
    app.kubernetes.io/name: gitlab-ci-kubernetes-namespace-cleaner
spec:
  schedule: '0 4 * * *'
  successfulJobsHistoryLimit: 1
  failedJobsHistoryLimit: 3
  concurrencyPolicy: Forbid
  startingDeadlineSeconds: 120
  jobTemplate:
    spec:
      template:
        metadata:
          labels:
            app.kubernetes.io/name: gitlab-ci-kubernetes-namespace-cleaner
        spec:
          serviceAccountName: cleaner
          restartPolicy: Never
          containers:
            - name: cleaner
              image: antonjohansson/gitlab-ci-kubernetes-namespace-cleaner:v0.1.0
