diff --git a/modules/infrastructure-moving-monitoring.adoc b/modules/infrastructure-moving-monitoring.adoc index f0c3ea5cb9d1..39a2fc51b177 100644 --- a/modules/infrastructure-moving-monitoring.adoc +++ b/modules/infrastructure-moving-monitoring.adoc @@ -5,10 +5,61 @@ [id="infrastructure-moving-monitoring-{context}"] = Moving the monitoring solution -[IMPORTANT] -==== -The monitoring solution uses Cluster Version Operator (CVO) to create the -ConfigMap that the monitoring Operator uses to determine how to deploy its -resources. Because it uses the CVO and users cannot modify the CVO, you cannot -change where the Operator deploys resources. -==== \ No newline at end of file + +By default, the Prometheus Cluster Monitoring stack, which contains Prometheus, +Grafana, and AlertManager, is deployed to +provide cluster monitoring. It is managed by the Cluster Monitoring Operator. +To move its components to different machines, you create and apply a custom +ConfigMap. + +.Procedure + +. Save the following ConfigMap definition as the +`cluster-monitoring-configmap.yaml` file: ++ +[source,yaml] +---- +apiVersion: v1 +kind: ConfigMap +metadata: + name: cluster-monitoring-config + namespace: openshift-monitoring +data: + config.yaml: |+ + alertmanagerMain: + nodeSelector: + node-role.kubernetes.io/infra: "" + prometheusK8s: + nodeSelector: + node-role.kubernetes.io/infra: "" + prometheusOperator: + nodeSelector: + node-role.kubernetes.io/infra: "" + grafana: + nodeSelector: + node-role.kubernetes.io/infra: "" + k8sPrometheusAdapter: + nodeSelector: + node-role.kubernetes.io/infra: "" + kubeStateMetrics: + nodeSelector: + node-role.kubernetes.io/infra: "" + telemeterClient: + nodeSelector: + node-role.kubernetes.io/infra: "" +---- ++ +Running this ConfigMap forces the components of the monitoring stack to redeploy +to infrastructure nodes. + +. Apply the new ConfigMap: ++ +---- +$ oc create -f cluster-monitoring-configmap.yaml +---- + +. Watch the monitoring Pods move to the new machines: ++ +---- +$ watch 'oc get pod -n openshift-monitoring -o wide' +---- \ No newline at end of file