|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * monitoring/configuring-the-monitoring-stack.adoc |
| 4 | + |
| 5 | +:_mod-docs-content-type: PROCEDURE |
| 6 | +[id="specifying-limits-and-resource-requests-for-monitoring-components_{context}"] |
| 7 | += Specifying limits and requests for monitoring components |
| 8 | + |
| 9 | +To configure CPU and memory resources, specify values for resource limits and requests in the appropriate `ConfigMap` object for the namespace in which the monitoring component is located: |
| 10 | + |
| 11 | +* The `cluster-monitoring-config` config map in the `openshift-monitoring` namespace for core platform monitoring |
| 12 | +* The `user-workload-monitoring-config` config map in the `openshift-user-workload-monitoring` namespace for components that monitor user-defined projects |
| 13 | +
|
| 14 | +.Prerequisites |
| 15 | + |
| 16 | +* *If you are configuring core platform monitoring components*: |
| 17 | +** You have access to the cluster as a user with the `cluster-admin` cluster role. |
| 18 | +** You have created a `ConfigMap` object named `cluster-monitoring-config`. |
| 19 | +* *If you are configuring components that monitor user-defined projects*: |
| 20 | +** You have access to the cluster as a user with the `cluster-admin` cluster role, or as a user with the `user-workload-monitoring-config-edit` role in the `openshift-user-workload-monitoring` project. |
| 21 | +* You have installed the OpenShift CLI (`oc`). |
| 22 | +
|
| 23 | +.Procedure |
| 24 | + |
| 25 | +. To configure core platform monitoring components, edit the `cluster-monitoring-config` config map object in the `openshift-monitoring` namespace: |
| 26 | ++ |
| 27 | +[source,terminal] |
| 28 | +---- |
| 29 | +$ oc -n openshift-monitoring edit configmap cluster-monitoring-config |
| 30 | +---- |
| 31 | + |
| 32 | +. Add values to define resource limits and requests for each core platform monitoring component you want to configure. |
| 33 | ++ |
| 34 | +[IMPORTANT] |
| 35 | +==== |
| 36 | +Make sure that the value set for a limit is always higher than the value set for a request. |
| 37 | +Otherwise, an error will occur, and the container will not run. |
| 38 | +==== |
| 39 | ++ |
| 40 | +.Example |
| 41 | ++ |
| 42 | +[source,yaml] |
| 43 | +---- |
| 44 | +apiVersion: v1 |
| 45 | +kind: ConfigMap |
| 46 | +metadata: |
| 47 | + name: cluster-monitoring-config |
| 48 | + namespace: openshift-monitoring |
| 49 | +data: |
| 50 | + config.yaml: | |
| 51 | + alertmanagerMain: |
| 52 | + resources: |
| 53 | + limits: |
| 54 | + cpu: 500m |
| 55 | + memory: 1Gi |
| 56 | + requests: |
| 57 | + cpu: 200m |
| 58 | + memory: 500Mi |
| 59 | + prometheusK8s: |
| 60 | + resources: |
| 61 | + limits: |
| 62 | + cpu: 500m |
| 63 | + memory: 3Gi |
| 64 | + requests: |
| 65 | + cpu: 200m |
| 66 | + memory: 500Mi |
| 67 | + prometheusOperator: |
| 68 | + resources: |
| 69 | + limits: |
| 70 | + cpu: 500m |
| 71 | + memory: 1Gi |
| 72 | + requests: |
| 73 | + cpu: 200m |
| 74 | + memory: 500Mi |
| 75 | + k8sPrometheusAdapter: |
| 76 | + resources: |
| 77 | + limits: |
| 78 | + cpu: 500m |
| 79 | + memory: 1Gi |
| 80 | + requests: |
| 81 | + cpu: 200m |
| 82 | + memory: 500Mi |
| 83 | + kubeStateMetrics: |
| 84 | + resources: |
| 85 | + limits: |
| 86 | + cpu: 500m |
| 87 | + memory: 1Gi |
| 88 | + requests: |
| 89 | + cpu: 200m |
| 90 | + memory: 500Mi |
| 91 | + telemeterClient: |
| 92 | + resources: |
| 93 | + limits: |
| 94 | + cpu: 500m |
| 95 | + memory: 1Gi |
| 96 | + requests: |
| 97 | + cpu: 200m |
| 98 | + memory: 500Mi |
| 99 | + openshiftStateMetrics: |
| 100 | + resources: |
| 101 | + limits: |
| 102 | + cpu: 500m |
| 103 | + memory: 1Gi |
| 104 | + requests: |
| 105 | + cpu: 200m |
| 106 | + memory: 500Mi |
| 107 | + thanosQuerier: |
| 108 | + resources: |
| 109 | + limits: |
| 110 | + cpu: 500m |
| 111 | + memory: 1Gi |
| 112 | + requests: |
| 113 | + cpu: 200m |
| 114 | + memory: 500Mi |
| 115 | + nodeExporter: |
| 116 | + resources: |
| 117 | + limits: |
| 118 | + cpu: 50m |
| 119 | + memory: 150Mi |
| 120 | + requests: |
| 121 | + cpu: 20m |
| 122 | + memory: 50Mi |
| 123 | + monitoringPlugin: |
| 124 | + resources: |
| 125 | + limits: |
| 126 | + cpu: 500m |
| 127 | + memory: 1Gi |
| 128 | + requests: |
| 129 | + cpu: 200m |
| 130 | + memory: 500Mi |
| 131 | + prometheusOperatorAdmissionWebhook: |
| 132 | + resources: |
| 133 | + limits: |
| 134 | + cpu: 50m |
| 135 | + memory: 100Mi |
| 136 | + requests: |
| 137 | + cpu: 20m |
| 138 | + memory: 50Mi |
| 139 | +---- |
| 140 | + |
| 141 | +. Save the file to apply the changes automatically. |
| 142 | ++ |
| 143 | +[IMPORTANT] |
| 144 | +==== |
| 145 | +When you save changes to the `cluster-monitoring-config` config map, the pods and other resources in the `openshift-monitoring` project might be redeployed. |
| 146 | +The running monitoring processes in that project might also restart. |
| 147 | +==== |
| 148 | + |
0 commit comments