Skip to content

Latest commit

 

History

History
82 lines (72 loc) · 2.21 KB

monitoring-moving-monitoring-components-to-different-nodes.adoc

File metadata and controls

82 lines (72 loc) · 2.21 KB

Moving monitoring components to different nodes

You can move any of the monitoring stack components to specific nodes.

Prerequisites
  • Make sure you have the cluster-monitoring-config ConfigMap object with the data/config.yaml section.

Procedure
  1. Start editing the cluster-monitoring-config ConfigMap:

    $ oc -n openshift-monitoring edit configmap cluster-monitoring-config
  2. Specify the nodeSelector constraint for the component under data/config.yaml:

    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: cluster-monitoring-config
      namespace: openshift-monitoring
    data:
      config.yaml: |
        <component>:
          nodeSelector:
            <node_key>: <node_value>
            <node_key>: <node_value>
            <...>

    Substitute <component> accordingly and substitute <node_key>: <node_value> with the map of key-value pairs that specifies the destination node. Often, only a single key-value pair is used.

    The component can only run on a node that has each of the specified key-value pairs as labels. The node can have additional labels as well.

    For example, to move components to the node that is labeled foo: bar, use:

    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: cluster-monitoring-config
      namespace: openshift-monitoring
    data:
      config.yaml: |
        prometheusOperator:
          nodeSelector:
            foo: bar
        prometheusK8s:
          nodeSelector:
            foo: bar
        alertmanagerMain:
          nodeSelector:
            foo: bar
        kubeStateMetrics:
          nodeSelector:
            foo: bar
        grafana:
          nodeSelector:
            foo: bar
        telemeterClient:
          nodeSelector:
            foo: bar
        k8sPrometheusAdapter:
          nodeSelector:
            foo: bar
  3. Save the file to apply the changes. The components affected by the new configuration are moved to new nodes automatically.

Additional resources