Chapter 13. Observability for hosted control planes
You can gather metrics for hosted control planes by configuring metrics sets. The HyperShift Operator can create or delete monitoring dashboards in the management cluster for each hosted cluster that it manages.
13.1. Configuring metrics sets for hosted control planes Copy linkLink copied to clipboard!
Hosted control planes for Red Hat OpenShift Container Platform creates ServiceMonitor resources in each control plane namespace that allow a Prometheus stack to gather metrics from the control planes. The ServiceMonitor resources use metrics relabelings to define which metrics are included or excluded from a particular component, such as etcd or the Kubernetes API server. The number of metrics that are produced by control planes directly impacts the resource requirements of the monitoring stack that gathers them.
Instead of producing a fixed number of metrics that apply to all situations, you can configure a metrics set that identifies a set of metrics to produce for each control plane. The following metrics sets are supported:
-
Telemetry: These metrics are needed for telemetry. This set is the default set and is the smallest set of metrics. -
SRE: This set includes the necessary metrics to produce alerts and allow the troubleshooting of control plane components. -
All: This set includes all of the metrics that are produced by standalone OpenShift Container Platform control plane components.
To configure a metrics set, set the METRICS_SET environment variable in the HyperShift Operator deployment by entering the following command:
oc set env -n hypershift deployment/operator METRICS_SET=All
$ oc set env -n hypershift deployment/operator METRICS_SET=All
13.1.1. Configuring the SRE metrics set Copy linkLink copied to clipboard!
When you specify the SRE metrics set, the HyperShift Operator looks for a config map named sre-metric-set with a single key: config. The value of the config key must contain a set of RelabelConfigs that are organized by control plane component.
You can specify the following components:
-
etcd -
kubeAPIServer -
kubeControllerManager -
openshiftAPIServer -
openshiftControllerManager -
openshiftRouteControllerManager -
cvo -
olm -
catalogOperator -
registryOperator -
nodeTuningOperator -
controlPlaneOperator -
hostedClusterConfigOperator
A configuration of the SRE metrics set is illustrated in the following example:
13.2. Enabling monitoring dashboards in a hosted cluster Copy linkLink copied to clipboard!
You can enable monitoring dashboards in a hosted cluster by creating a config map.
Procedure
Create the
hypershift-operator-install-flagsconfig map in thelocal-clusternamespace. See the following example configuration:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- The
--monitoring-dashboards --metrics-set=Allflag adds the monitoring dashboard for all metrics.
Wait a couple of minutes for the HyperShift Operator deployment in the
hypershiftnamespace to be updated to include the following environment variable:- name: MONITORING_DASHBOARDS value: "1"- name: MONITORING_DASHBOARDS value: "1"Copy to Clipboard Copied! Toggle word wrap Toggle overflow When monitoring dashboards are enabled, for each hosted cluster that the HyperShift Operator manages, the Operator creates a config map named
cp-<hosted_cluster_namespace>-<hosted_cluster_name>in theopenshift-config-managednamespace, where<hosted_cluster_namespace>is the namespace of the hosted cluster and<hosted_cluster_name>is the name of the hosted cluster. As a result, a new dashboard is added in the administrative console of the management cluster.-
To view the dashboard, log in to the management cluster’s console and go to the dashboard for the hosted cluster by clicking Observe
Dashboards. -
Optional: To disable monitoring dashboards in a hosted cluster, remove the
--monitoring-dashboards --metrics-set=Allflag from thehypershift-operator-install-flagsconfig map. When you delete a hosted cluster, its corresponding dashboard is also deleted.
13.2.1. Dashboard customization Copy linkLink copied to clipboard!
To generate dashboards for each hosted cluster, the HyperShift Operator uses a template that is stored in the monitoring-dashboard-template config map in the Operator namespace (hypershift). This template contains a set of Grafana panels that contain the metrics for the dashboard. You can edit the content of the config map to customize the dashboards.
When a dashboard is generated, the following strings are replaced with values that correspond to a specific hosted cluster:
| Name | Description |
|---|---|
|
| The name of the hosted cluster |
|
| The namespace of the hosted cluster |
|
| The namespace where the control plane pods of the hosted cluster are placed |
|
|
The UUID of the hosted cluster, which matches the |
13.3. Connectivity monitoring for hosted control planes Copy linkLink copied to clipboard!
Cluster service providers can monitor connectivity metrics to ensure proper function during an update and to determine whether any connectivity issues exist between the control plane and the data plane. By studying the metrics over time, they can also be better equipped to make decisions about capacity planning and scaling.
13.3.1. Connectivity monitoring from the control plane to the data plane Copy linkLink copied to clipboard!
Cluster administrators can monitor network activity between a hosted control plane and the compute nodes in a data plane by using the DataPlaneConnectionAvailable condition. This condition is useful for identifying and troubleshooting network connectivity issues in hosted clusters.
The DataPlaneConnectionAvailable condition is available by default starting with version 4.21.
The DataPlaneConnectionAvailable condition monitors the connectivity from the control plane to the data plane by taking the following steps:
- Counts available compute nodes in the hosted cluster.
-
Lists the
konnectivity-agentpods that are running in thekube-systemnamespace on the data plane. -
Reads the logs from the running
konnectivity-agentpod to verify that it can communicate with the data plane.
The hosted-cluster-config-operator component that runs in the control plane namespace evaluates the condition and provides status and reason information.
The following table details the status and reason values that can be displayed for the condition:
| Status | Reason value | Description |
|---|---|---|
|
|
|
The control plane can reach the data plane nodes through the |
|
|
|
No |
|
|
|
An error occurred while listing the |
|
|
| No compute nodes are available in the cluster. No errors occurred, but no compute nodes were found. |
|
|
| Unable to count compute nodes because an error occurred. |
For information about how to troubleshoot connectivity issues, see "Troubleshooting connectivity for hosted control planes".