From bbc482d82fc7c6a5bdfd40a900e9d84ed64f55f0 Mon Sep 17 00:00:00 2001 From: Redouane Kachach Date: Fri, 8 Mar 2024 14:38:27 +0100 Subject: [PATCH 1/2] exporter: applying labels from monitoring section to ceph-exporter the labels listed under the 'monitoring' section are currently only being applied to the rook-ceph-mgr ServiceMonitor. This change extends those labels to also include the rook-ceph-exporter ServiceMonitor. Fixes: https://github.com/rook/rook/issues/13774 Signed-off-by: Redouane Kachach (cherry picked from commit 10e26709c45441352ee9a36a9faa4e5e95fade52) --- pkg/operator/ceph/cluster/nodedaemon/exporter.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/operator/ceph/cluster/nodedaemon/exporter.go b/pkg/operator/ceph/cluster/nodedaemon/exporter.go index f0a196384..946eac4da 100644 --- a/pkg/operator/ceph/cluster/nodedaemon/exporter.go +++ b/pkg/operator/ceph/cluster/nodedaemon/exporter.go @@ -261,6 +261,7 @@ func EnableCephExporterServiceMonitor(context *clusterd.Context, cephCluster cep func applyCephExporterLabels(cephCluster cephv1.CephCluster, serviceMonitor *monitoringv1.ServiceMonitor) { if cephCluster.Spec.Labels != nil { + cephv1.GetMonitoringLabels(cephCluster.Spec.Labels).OverwriteApplyToObjectMeta(&serviceMonitor.ObjectMeta) if cephExporterLabels, ok := cephCluster.Spec.Labels["exporter"]; ok { if managedBy, ok := cephExporterLabels["rook.io/managedBy"]; ok { relabelConfig := monitoringv1.RelabelConfig{ From 6cc8ef770d4cae8e7bdf7783da0049025392d963 Mon Sep 17 00:00:00 2001 From: Redouane Kachach Date: Tue, 12 Mar 2024 17:20:52 +0100 Subject: [PATCH 2/2] doc: adding a doc example for ceph-exporter labels Signed-off-by: Redouane Kachach (cherry picked from commit ab5b269bc48a3b868b43f125a0d74607e5f4a71c) --- deploy/examples/cluster.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/deploy/examples/cluster.yaml b/deploy/examples/cluster.yaml index 57fc25790..69b02a3ff 100644 --- a/deploy/examples/cluster.yaml +++ b/deploy/examples/cluster.yaml @@ -206,6 +206,8 @@ spec: # cleanup: # mgr: # prepareosd: + # These labels are applied to ceph-exporter servicemonitor only + # exporter: # monitoring is a list of key-value pairs. It is injected into all the monitoring resources created by operator. # These labels can be passed as LabelSelector to Prometheus # monitoring: