Skip to content

Latest commit

 

History

History
63 lines (54 loc) · 1.74 KB

monitoring-configuring-the-cluster-monitoring-stack.adoc

File metadata and controls

63 lines (54 loc) · 1.74 KB

Configuring the cluster monitoring stack

You can configure the Prometheus Cluster Monitoring stack using ConfigMaps. ConfigMaps configure the Cluster Monitoring Operator, which in turn configures components of the stack.

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. Put your configuration under data/config.yaml as key-value pair <component_name>: <component_configuration>:

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

    Substitute <component> and <configuration_for_the_component> accordingly.

    For example, create this ConfigMap to configure a Persistent Volume Claim (PVC) for Prometheus:

    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: cluster-monitoring-config
      namespace: openshift-monitoring
    data:
      config.yaml: |
        prometheusK8s:
          volumeClaimTemplate:
           spec:
             storageClassName: fast
             volumeMode: Filesystem
             resources:
               requests:
                 storage: 40Gi

    Here, prometheusK8s defines the Prometheus component and the following lines define its configuration.

  3. Save the file to apply the changes. The pods affected by the new configuration are restarted automatically.