Skip to content

Commit

Permalink
Merge pull request #13902 from rkachach/fix_issue_13774
Browse files Browse the repository at this point in the history
exporter: applying labels from monitoring section to ceph-exporter
  • Loading branch information
travisn committed Mar 13, 2024
2 parents 15f92a1 + ab5b269 commit c409a6a
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 @@ -262,6 +262,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 c409a6a

Please sign in to comment.