This is an automated email from the ASF dual-hosted git repository.

lhotari pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar-helm-chart.git


The following commit(s) were added to refs/heads/master by this push:
     new 5d3ca55  feat: added global labelselector feature for podmonitors 
(#402)
5d3ca55 is described below

commit 5d3ca5510d1aedee5c1206ac8b1f5cfbddef8f10
Author: Daniel Kovacs <[email protected]>
AuthorDate: Mon May 4 15:51:02 2026 +0200

    feat: added global labelselector feature for podmonitors (#402)
    
    Co-authored-by: Daniel Kovacs <[email protected]>
    Co-authored-by: Lari Hotari <[email protected]>
---
 .ci/templates-all-values.yaml        | 11 +++++++++++
 charts/pulsar/templates/_monitor.tpl |  3 +++
 charts/pulsar/values.yaml            |  5 +++++
 3 files changed, 19 insertions(+)

diff --git a/.ci/templates-all-values.yaml b/.ci/templates-all-values.yaml
index e8914a3..e6aaaf2 100644
--- a/.ci/templates-all-values.yaml
+++ b/.ci/templates-all-values.yaml
@@ -80,6 +80,17 @@ affinity:
   anti_affinity: true
   type: requiredDuringSchedulingIgnoredDuringExecution
 
+# -----------------------------------------------------------------------------
+# Global pod-scrape settings -- multi-element customLabels map exercises the
+# `toYaml | nindent` injection in the shared `pulsar.podMonitor` helper
+# (_monitor.tpl), which feeds every *-podmonitor.yaml template (Prometheus
+# PodMonitor here, VictoriaMetrics VMPodScrape when the subchart is enabled).
+# -----------------------------------------------------------------------------
+podMonitor:
+  customLabels:
+    monitoring-team: platform
+    cost-center: infra-prod
+
 # -----------------------------------------------------------------------------
 # Persistence -- on, with non-local storage classes
 # Exercises: bookkeeper-statefulset.yaml volumeClaimTemplates and
diff --git a/charts/pulsar/templates/_monitor.tpl 
b/charts/pulsar/templates/_monitor.tpl
index b93aaed..c8a26b1 100644
--- a/charts/pulsar/templates/_monitor.tpl
+++ b/charts/pulsar/templates/_monitor.tpl
@@ -44,6 +44,9 @@ metadata:
   name: {{ template "pulsar.fullname" $root }}-{{ replace "." "-" $component }}
   labels:
     {{- include "pulsar.standardLabels" $root | nindent 4 }}
+    {{- if and $root.Values.podMonitor $root.Values.podMonitor.customLabels }}
+    {{- toYaml $root.Values.podMonitor.customLabels | nindent 4 }}
+    {{- end }}
 spec:
   jobLabel: {{ replace "." "-" $component }}
   podMetricsEndpoints:
diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml
index c4d3d01..76c61d1 100755
--- a/charts/pulsar/values.yaml
+++ b/charts/pulsar/values.yaml
@@ -50,6 +50,11 @@ useReleaseStatus: true
 #   environment: dev
 #   customer: apache
 
+## Global metric scraping settings
+podMonitor:
+  # Add custom labels to the podMonitor resources
+  customLabels: {}
+
 ## Pulsar Metadata Prefix
 ##
 ## By default, pulsar stores all the metadata at root path.

Reply via email to