Configuring components that monitor user-defined projects

  • Edit the cluster-monitoring-config configmap object in the openshift-monitoring project:

    cat << EOF | oc apply --validate -f -
    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: user-workload-monitoring-config
      namespace: openshift-user-workload-monitoring
    data:
      config.yaml: |
        prometheus: 
          retention: 24h 
          resources:
            requests:
              cpu: 200m 
              memory: 2Gi
    EOF
    

    For more information about UserWorkloadConfiguration options, see https://docs.redhat.com/documentation/openshift_container_platform/4.17/html/monitoring/config-map-reference-for-the-cluster-monitoring-operator#userworkloadconfiguration.

    • Defines the Prometheus component and the subsequent lines define its configuration.
    • Configures a twenty-four-hour data retention period for the Prometheus instance that monitors user-defined projects.
    • Defines a minimum resource request of 200 millicores for the Prometheus container.
    • Defines a minimum pod resource request of 2 GiB of memory for the Prometheus container.