From e38bf3a2cb4eb616bab693b526a52f1371702334 Mon Sep 17 00:00:00 2001 From: Laura Hinson Date: Tue, 17 Oct 2023 11:51:11 -0400 Subject: [PATCH] Add monitoring dashboard docs for hosted control planes --- hosted_control_planes/hcp-managing.adoc | 1 + ...d-control-planes-monitoring-dashboard.adoc | 61 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 modules/hosted-control-planes-monitoring-dashboard.adoc diff --git a/hosted_control_planes/hcp-managing.adoc b/hosted_control_planes/hcp-managing.adoc index a135e5a699..05779ff08f 100644 --- a/hosted_control_planes/hcp-managing.adoc +++ b/hosted_control_planes/hcp-managing.adoc @@ -17,6 +17,7 @@ include::modules/updating-node-pools-for-hcp.adoc[leveloffset=+1] include::modules/hosted-control-planes-pause-reconciliation.adoc[leveloffset=+1] //using service-level DNS for control plane services include::modules/hosted-control-planes-metrics-sets.adoc[leveloffset=+1] +include::modules/hosted-control-planes-monitoring-dashboard.adoc[leveloffset=+1] //automated machine management include::modules/scale-down-data-plane.adoc[leveloffset=+1] include::modules/delete-hosted-cluster.adoc[leveloffset=+1] diff --git a/modules/hosted-control-planes-monitoring-dashboard.adoc b/modules/hosted-control-planes-monitoring-dashboard.adoc new file mode 100644 index 0000000000..32a8d04b19 --- /dev/null +++ b/modules/hosted-control-planes-monitoring-dashboard.adoc @@ -0,0 +1,61 @@ +// Module included in the following assemblies: +// +// * hosted_control_planes/hcp-managing.adoc + +:_content-type: PROCEDURE +[id="hosted-control-planes-monitoring-dashboard_{context}"] += Creating monitoring dashboards for hosted clusters + +The HyperShift Operator can create or delete monitoring dashboards in the management cluster for each hosted cluster that it manages. + +[#hosted-control-planes-enable-dashboard] +== Enabling monitoring dashboards + +To enable monitoring dashboards in a hosted cluster, complete the following steps: + +.Procedure + +. Create the `hypershift-operator-install-flags` config map in the `local-cluster` namespace, being sure to specify the `--monitoring-dashboards` flag in the `data.installFlagsToAdd` section. For example: + ++ +[source,yaml] +---- +kind: ConfigMap +apiVersion: v1 +metadata: + name: hypershift-operator-install-flags + namespace: local-cluster +data: + installFlagsToAdd: "--monitoring-dashboards" + installFlagsToRemove: "" +---- + +. Wait a couple of minutes for the HyperShift Operator deployment in the `hypershift` namespace to be updated to include the following environment variable: + ++ +---- + - name: MONITORING_DASHBOARDS + value: "1" +---- + ++ +When monitoring dashboards are enabled, for each hosted cluster that the HyperShift Operator manages, the Operator creates a config map named `cp-[NAMESPACE]-[NAME]` in the `openshift-config-managed` namespace, where `NAMESPACE` is the namespace of the hosted cluster and `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 a monitoring dashboards in a hosted cluster, remove the `--monitoring-dashboards` flag from the `hypershift-operator-install-flags` config map. When you delete a hosted cluster, its corresponding dashboard is also deleted. + +[#hosted-control-planes-customize-dashboards] +== Dashboard customization + +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 +| [x-]`__NAME__` | The name of the hosted cluster +| [x-]`__NAMESPACE__` | The namespace of the hosted cluster +| [x-]`__CONTROL_PLANE_NAMESPACE__` | The namespace where the control plane pods of the hosted cluster are placed +| [x-]`__CLUSTER_ID__` | The UUID of the hosted cluster, which matches the `_id` label of the hosted cluster metrics +|=== \ No newline at end of file