Skip to content

Commit

Permalink
Merge pull request #13924 from rook/mergify/bp/release-1.13/pr-13902
Browse files Browse the repository at this point in the history
exporter: applying labels from monitoring section to ceph-exporter (backport #13902)
  • Loading branch information
travisn committed Mar 13, 2024
2 parents 1c8abbe + 6cc8ef7 commit b79cc91
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions deploy/examples/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions pkg/operator/ceph/cluster/nodedaemon/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit b79cc91

Please sign in to comment.