Creating config map

Create a config map by using an YAML.

Procedure

  1. Go to project: openshift-monitoring.
  2. Go to Config Maps and create a config map using the following YAML.
    1. Set the enableUserWorkload setting to "true" under data/config.yaml
  3. Save the file to apply the changes. It creates a new operator and prometheus instance in the openshift-monitoring-user-workload namespace, and this instance is able to monitor servicemonitor kinds in the namespace.
    YAML:
    apiVersion: v1
    kind: ConfigMap
    metadata:
       name: cluster-monitoring-config
    data:
      config.yaml: |
        enableUserWorkload: true
    $ oc -n openshift-user-workload-monitoring get pod
    NAME                                   READY   STATUS        RESTARTS   AGE
    prometheus-operator-6f7b748d5b-t7nbg   2/2     Running       0          3h
    prometheus-user-workload-0             5/5     Running       1          3h
    prometheus-user-workload-1             5/5     Running       1          3h
    thanos-ruler-user-workload-0           3/3     Running       0          3h
    thanos-ruler-user-workload-1           3/3     Running       0          3h