×

Cluster Monitoring Operator configuration reference

Parts of OpenShift Container Platform cluster monitoring are configurable. The API is accessible by setting parameters defined in various config maps.

  • To configure monitoring components, edit the ConfigMap object named cluster-monitoring-config in the openshift-monitoring namespace. These configurations are defined by ClusterMonitoringConfiguration.

  • To configure monitoring components that monitor user-defined projects, edit the ConfigMap object named user-workload-monitoring-config in the openshift-user-workload-monitoring namespace. These configurations are defined by UserWorkloadConfiguration.

The configuration file is always defined under the config.yaml key in the config map data.

  • Not all configuration parameters are exposed.

  • Configuring cluster monitoring is optional.

  • If a configuration does not exist or is empty, default values are used.

  • If the configuration is invalid YAML data, the Cluster Monitoring Operator stops reconciling the resources and reports Degraded=True in the status conditions of the Operator.

AdditionalAlertmanagerConfig

Description

The AdditionalAlertmanagerConfig resource defines settings for how a component communicates with additional Alertmanager instances.

Required

  • apiVersion

Property Type Description

apiVersion

string

Defines the API version of Alertmanager. Possible values are v1 or v2. The default is v2.

bearerToken

*v1.SecretKeySelector

Defines the secret key reference containing the bearer token to use when authenticating to Alertmanager.

pathPrefix

string

Defines the path prefix to add in front of the push endpoint path.

scheme

string

Defines the URL scheme to use when communicating with Alertmanager instances. Possible values are http or https. The default value is http.

staticConfigs

[]string

A list of statically configured Alertmanager endpoints in the form of <hosts>:<port>.

timeout

*string

Defines the timeout value used when sending alerts.

tlsConfig

TLSConfig

Defines the TLS settings to use for Alertmanager connections.

AlertmanagerMainConfig

Description

The AlertmanagerMainConfig resource defines settings for the Alertmanager component in the openshift-monitoring namespace.

Property Type Description

enabled

*bool

A Boolean flag that enables or disables the main Alertmanager instance in the openshift-monitoring namespace. The default value is true.

enableUserAlertmanagerConfig

bool

A Boolean flag that enables or disables user-defined namespaces to be selected for AlertmanagerConfig lookups. This setting only applies if the user workload monitoring instance of Alertmanager is not enabled. The default value is false.

logLevel

string

Defines the log level setting for Alertmanager. The possible values are: error, warn, info, debug. The default value is info.

nodeSelector

map[string]string

Defines the nodes on which the Pods are scheduled.

resources

*v1.ResourceRequirements

Defines resource requests and limits for the Alertmanager container.

tolerations

[]v1.Toleration

Defines tolerations for the pods.

volumeClaimTemplate

*monv1.EmbeddedPersistentVolumeClaim

Defines persistent storage for Alertmanager. Use this setting to configure the persistent volume claim, including storage class, volume size, and name.

AlertmanagerUserWorkloadConfig

Description

The AlertmanagerUserWorkloadConfig resource defines the settings for the Alertmanager instance used for user-defined projects.

Property Type Description

enabled

bool

A Boolean flag that enables or disables a dedicated instance of Alertmanager for user-defined alerts in the openshift-user-workload-monitoring namespace. The default value is false.

enableAlertmanagerConfig

bool

A Boolean flag to enable or disable user-defined namespaces to be selected for AlertmanagerConfig lookup. The default value is false.

logLevel

string

Defines the log level setting for Alertmanager for user workload monitoring. The possible values are error, warn, info, and debug. The default value is info.

resources

*v1.ResourceRequirements

Defines resource requests and limits for the Alertmanager container.

nodeSelector

map[string]string

Defines the nodes on which the pods are scheduled.

tolerations

[]v1.Toleration

Defines tolerations for the pods.

volumeClaimTemplate

*monv1.EmbeddedPersistentVolumeClaim

Defines persistent storage for Alertmanager. Use this setting to configure the persistent volume claim, including storage class, volume size and name.

ClusterMonitoringConfiguration

Description

The ClusterMonitoringConfiguration resource defines settings that customize the default platform monitoring stack through the cluster-monitoring-config config map in the openshift-monitoring namespace.

Property Type Description

alertmanagerMain

*AlertmanagerMainConfig

AlertmanagerMainConfig defines settings for the Alertmanager component in the openshift-monitoring namespace.

enableUserWorkload

*bool

UserWorkloadEnabled is a Boolean flag that enables monitoring for user-defined projects.

k8sPrometheusAdapter

*K8sPrometheusAdapter

K8sPrometheusAdapter defines settings for the Prometheus Adapter component.

kubeStateMetrics

*KubeStateMetricsConfig

KubeStateMetricsConfig defines settings for the kube-state-metrics agent.

prometheusK8s

*PrometheusK8sConfig

PrometheusK8sConfig defines settings for the Prometheus component.

prometheusOperator

*PrometheusOperatorConfig

PrometheusOperatorConfig defines settings for the Prometheus Operator component.

openshiftStateMetrics

*OpenShiftStateMetricsConfig

OpenShiftMetricsConfig defines settings for the openshift-state-metrics agent.

telemeterClient

*TelemeterClientConfig

TelemeterClientConfig defines settings for the Telemeter Client component.

thanosQuerier

*ThanosQuerierConfig

ThanosQuerierConfig defines settings for the Thanos Querier component.

DedicatedServiceMonitors

Description

You can use the DedicatedServiceMonitors resource to configure dedicated Service Monitors for the Prometheus Adapter

Appears in: K8sPrometheusAdapter

Property Type Description

enabled

bool

When enabled is set to true, the Cluster Monitoring Operator (CMO) deploys a dedicated Service Monitor that exposes the kubelet /metrics/resource endpoint. This Service Monitor sets honorTimestamps: true and only keeps metrics that are relevant for the pod resource queries of Prometheus Adapter. Additionally, Prometheus Adapter is configured to use these dedicated metrics. Overall, this feature improves the consistency of Prometheus Adapter-based CPU usage measurements used by, for example, the oc adm top pod command or the Horizontal Pod Autoscaler.

K8sPrometheusAdapter

Description

The K8sPrometheusAdapter resource defines settings for the Prometheus Adapter component.

Property Type Description

audit

*Audit

Defines the audit configuration used by the Prometheus Adapter instance. Possible profile values are: metadata, request, requestresponse, and none. The default value is metadata.

nodeSelector

map[string]string

Defines the nodes on which the pods are scheduled.

tolerations

[]v1.Toleration

Defines tolerations for the pods.

dedicatedServiceMonitors

*DedicatedServiceMonitors

Defines dedicated service monitors.

KubeStateMetricsConfig

Description

The KubeStateMetricsConfig resource defines settings for the kube-state-metrics agent.

Property Type Description

nodeSelector

map[string]string

Defines the nodes on which the pods are scheduled.

tolerations

[]v1.Toleration

Defines tolerations for the pods.

OpenShiftStateMetricsConfig

Description

The OpenShiftStateMetricsConfig resource defines settings for the openshift-state-metrics agent.

Property Type Description

nodeSelector

map[string]string

Defines the nodes on which the pods are scheduled.

tolerations

[]v1.Toleration

Defines tolerations for the pods.

PrometheusK8sConfig

Description

The PrometheusK8sConfig resource defines settings for the Prometheus component.

Property Type Description

additionalAlertmanagerConfigs

[]AdditionalAlertmanagerConfig