apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: reporting-server-clean-logs
spec:
  # Once a day
  schedule: "4 0 * * *"
  jobTemplate:
    spec:
      template:
        spec:
          restartPolicy: Never
          containers:
            - name: reporting-server-clean-logs
              image: rmf-web/reporting-server
              command:
                - /bin/sh
                - -c
                - reporting_server_clean_logs
              env:
                - name: RMF_REPORT_REST_SERVER_CONFIG
                  value: /reporting-server-config/reporting_server_config.py

              volumeMounts:
                - mountPath: /jwt-configmap
                  name: jwt-pub-key
                - mountPath: /reporting-server-config
                  name: reporting-server-config
          volumes:
            - name: jwt-pub-key
              configMap:
                name: jwt-pub-key
            - name: reporting-server-config
              configMap:
                name: reporting-server-config