diff --git a/charts/pulsar/templates/autorecovery-podmonitor.yaml b/charts/pulsar/templates/autorecovery-podmonitor.yaml index 3ec8968a..afe1408d 100644 --- a/charts/pulsar/templates/autorecovery-podmonitor.yaml +++ b/charts/pulsar/templates/autorecovery-podmonitor.yaml @@ -28,6 +28,9 @@ metadata: chart: {{ template "pulsar.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- if $.Values.podMonitor.customLabels }} + {{ $.Values.podMonitor.customLabels | toYaml | trim }} + {{- end }} spec: jobLabel: recovery podMetricsEndpoints: @@ -52,4 +55,4 @@ spec: matchLabels: {{- include "pulsar.matchLabels" . | nindent 6 }} component: {{ .Values.autorecovery.component }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/pulsar/templates/bookkeeper-podmonitor.yaml b/charts/pulsar/templates/bookkeeper-podmonitor.yaml index a85441be..0d6b8279 100644 --- a/charts/pulsar/templates/bookkeeper-podmonitor.yaml +++ b/charts/pulsar/templates/bookkeeper-podmonitor.yaml @@ -28,6 +28,9 @@ metadata: chart: {{ template "pulsar.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- if $.Values.podMonitor.customLabels }} + {{ $.Values.podMonitor.customLabels | toYaml | trim }} + {{- end }} spec: jobLabel: bookie podMetricsEndpoints: diff --git a/charts/pulsar/templates/broker-podmonitor.yaml b/charts/pulsar/templates/broker-podmonitor.yaml index 9ea0c4c2..d952d4e3 100644 --- a/charts/pulsar/templates/broker-podmonitor.yaml +++ b/charts/pulsar/templates/broker-podmonitor.yaml @@ -28,6 +28,9 @@ metadata: chart: {{ template "pulsar.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- if $.Values.podMonitor.customLabels }} + {{ $.Values.podMonitor.customLabels | toYaml | trim }} + {{- end }} spec: jobLabel: broker podMetricsEndpoints: diff --git a/charts/pulsar/templates/proxy-podmonitor.yaml b/charts/pulsar/templates/proxy-podmonitor.yaml index 66020dce..90206a3b 100644 --- a/charts/pulsar/templates/proxy-podmonitor.yaml +++ b/charts/pulsar/templates/proxy-podmonitor.yaml @@ -28,6 +28,9 @@ metadata: chart: {{ template "pulsar.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- if $.Values.podMonitor.customLabels }} + {{ $.Values.podMonitor.customLabels | toYaml | trim }} + {{- end }} spec: jobLabel: proxy podMetricsEndpoints: diff --git a/charts/pulsar/templates/zookeeper-podmonitor.yaml b/charts/pulsar/templates/zookeeper-podmonitor.yaml index 8da13ebc..50f02557 100644 --- a/charts/pulsar/templates/zookeeper-podmonitor.yaml +++ b/charts/pulsar/templates/zookeeper-podmonitor.yaml @@ -28,6 +28,9 @@ metadata: chart: {{ template "pulsar.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- if $.Values.podMonitor.customLabels }} + {{ $.Values.podMonitor.customLabels | toYaml | trim }} + {{- end }} spec: jobLabel: zookeeper podMetricsEndpoints: diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml index cbdc1bd2..f64e2a96 100644 --- a/charts/pulsar/values.yaml +++ b/charts/pulsar/values.yaml @@ -45,6 +45,11 @@ initialize: false # 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.