apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: olm-collect-profiles
spec:
  schedule: CRON_SCHEDULE
  jobTemplate:
    spec:
      template:
        spec:
          serviceAccountName: olm-collect-profiles
          priorityClassName: openshift-user-critical
          containers:
            - name: collect-profiles
              image: OLM_OPERATOR_IMAGE
              imagePullPolicy: IfNotPresent
              command:
                - bin/collect-profiles
              args:
                - -n
                - OLM_NAMESPACE
                - --config-mount-path
                - /etc/config
                - --cert-mount-path
                - /var/run/secrets/serving-cert
                - olm-operator-heap-:https://olm-operator-metrics:8443/debug/pprof/heap
                - catalog-operator-heap-:https://catalog-operator-metrics:8443/debug/pprof/heap
              volumeMounts:
                - mountPath: /etc/config
                  name: config-volume
                - mountPath: /var/run/secrets/serving-cert
                  name: secret-volume
              resources:
                requests:
                  cpu: 10m
                  memory: 80Mi
          volumes:
            - name: config-volume
              configMap:
                name: olm-collect-profiles
            - name: secret-volume
              secret:
                secretName: pprof-cert
          restartPolicy: Never
