apiVersion: batch/v1
kind: CronJob
metadata:
  name: curator-v2
  namespace: monitoring-ns
  labels:
    app: curator-v2
spec:
#  it will run every day at 1 am
  schedule: "0 1 * * *"
  successfulJobsHistoryLimit: 1
  failedJobsHistoryLimit: 3
  concurrencyPolicy: Forbid
  startingDeadlineSeconds: 120
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - image: petschenek/curator
            name: curator
            args: ["--config", "/etc/config/config.yml", "/etc/config/action_file.yml"]
            volumeMounts:
            - name: config
              mountPath: /etc/config
            resources:
              limits:
                cpu: 200m
                memory: 256Mi
              requests:
                cpu: 100m
                memory: 128Mi
            securityContext:
              runAsUser: 1000
          volumes:
          - name: config
            configMap:
              name: curator-config
          restartPolicy: OnFailure
          # If you use a private registry do not forget to add image pull secret
          #imagePullSecrets:
          #  - name: <secret-name>

