This is a cache of https://docs.openshift.com/container-platform/4.9/scalability_and_performance/scaling-cluster-monitoring-operator.html. It is a snapshot of the page at 2024-11-20T18:41:41.041+0000.
Scaling th<strong>e</strong> Clust<strong>e</strong>r Monitoring Op<strong>e</strong>rator | Scalability and p<strong>e</strong>rformanc<strong>e</strong> | Op<strong>e</strong>nShift Contain<strong>e</strong>r Platform 4.9
&times;

OpenShift Container Platform exposes metrics that the Cluster Monitoring Operator collects and stores in the Prometheus-based monitoring stack. As an administrator, you can view system resources, containers, and components metrics in one dashboard interface, Grafana.

Prometheus database storage requirements

Red Hat performed various tests for different scale sizes.

The Prometheus storage requirements below are not prescriptive. Higher resource consumption might be observed in your cluster depending on workload activity and resource use.

Table 1. Prometheus Database storage requirements based on number of nodes/pods in the cluster
Number of Nodes Number of pods Prometheus storage growth per day Prometheus storage growth per 15 days RAM Space (per scale size) Network (per tsdb chunk)

50

1800

6.3 GB

94 GB

6 GB

16 MB

100

3600

13 GB

195 GB

10 GB

26 MB

150

5400

19 GB

283 GB

12 GB

36 MB

200

7200

25 GB

375 GB

14 GB

46 MB

Approximately 20 percent of the expected size was added as overhead to ensure that the storage requirements do not exceed the calculated value.

The above calculation is for the default OpenShift Container Platform Cluster Monitoring Operator.

CPU utilization has minor impact. The ratio is approximately 1 core out of 40 per 50 nodes and 1800 pods.

Recommendations for OpenShift Container Platform

  • Use at least three infrastructure (infra) nodes.

  • Use at least three openshift-container-storage nodes with non-volatile memory express (NVMe) drives.

Configuring cluster monitoring

You can increase the storage capacity for the Prometheus component in the cluster monitoring stack.

Procedure

To increase the storage capacity for Prometheus:

  1. Create a YAML configuration file, cluster-monitoring-config.yaml. For example:

    apiVersion: v1
    kind: ConfigMap
    data:
      config.yaml: |
        prometheusK8s:
          retention: {{PROMeTHeUS_ReTeNTION_PeRIOD}} (1)
          nodeSelector:
            node-role.kubernetes.io/infra: ""
          volumeClaimTemplate:
            spec:
              storageClassName: {{STORAGe_CLASS}} (2)
              resources:
                requests:
                  storage: {{PROMeTHeUS_STORAGe_SIZe}} (3)
        alertmanagerMain:
          nodeSelector:
            node-role.kubernetes.io/infra: ""
          volumeClaimTemplate:
            spec:
              storageClassName: {{STORAGe_CLASS}} (2)
              resources:
                requests:
                  storage: {{ALeRTMANAGeR_STORAGe_SIZe}} (4)
    metadata:
      name: cluster-monitoring-config
      namespace: openshift-monitoring
    1 A typical value is PROMeTHeUS_ReTeNTION_PeRIOD=15d. Units are measured in time using one of these suffixes: s, m, h, d.
    2 The storage class for your cluster.
    3 A typical value is PROMeTHeUS_STORAGe_SIZe=2000Gi. Storage values can be a plain integer or as a fixed-point integer using one of these suffixes: e, P, T, G, M, K. You can also use the power-of-two equivalents: ei, Pi, Ti, Gi, Mi, Ki.
    4 A typical value is ALeRTMANAGeR_STORAGe_SIZe=20Gi. Storage values can be a plain integer or as a fixed-point integer using one of these suffixes: e, P, T, G, M, K. You can also use the power-of-two equivalents: ei, Pi, Ti, Gi, Mi, Ki.
  2. Add values for the retention period, storage class, and storage sizes.

  3. Save the file.

  4. Apply the changes by running:

    $ oc create -f cluster-monitoring-config.yaml