Creating config map
Create a config map by using an YAML.
Procedure
- Go to project:
openshift-monitoring
. - Go to Config Maps and create a config map using the following
YAML.
- Set the enableUserWorkload setting to "true" under
data/config.yaml
- Set the enableUserWorkload setting to "true" under
- 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