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 eedc21d  feat: add metricsRelabelings on podMonitor (#406)
eedc21d is described below

commit eedc21da30f20ea79f1f0d65ab169a31040a4b61
Author: lenglet-k <[email protected]>
AuthorDate: Thu Dec 21 17:24:49 2023 +0100

    feat: add metricsRelabelings on podMonitor (#406)
---
 charts/pulsar/templates/autorecovery-podmonitor.yaml |  3 +++
 charts/pulsar/templates/bookkeeper-podmonitor.yaml   |  3 +++
 charts/pulsar/templates/broker-podmonitor.yaml       |  3 +++
 charts/pulsar/templates/proxy-podmonitor.yaml        |  3 +++
 charts/pulsar/templates/zookeeper-podmonitor.yaml    |  3 +++
 charts/pulsar/values.yaml                            | 15 +++++++++++++++
 6 files changed, 30 insertions(+)

diff --git a/charts/pulsar/templates/autorecovery-podmonitor.yaml 
b/charts/pulsar/templates/autorecovery-podmonitor.yaml
index 3ec8968..213b589 100644
--- a/charts/pulsar/templates/autorecovery-podmonitor.yaml
+++ b/charts/pulsar/templates/autorecovery-podmonitor.yaml
@@ -48,6 +48,9 @@ spec:
         - sourceLabels: [__meta_kubernetes_pod_name]
           action: replace
           targetLabel: kubernetes_pod_name
+    {{- if $.Values.autorecovery.podMonitor.metricRelabelings }}
+      metricRelabelings: {{ toYaml 
$.Values.autorecovery.podMonitor.metricRelabelings | nindent 8 }}
+    {{- end }}
   selector:
     matchLabels:
       {{- include "pulsar.matchLabels" . | nindent 6 }}
diff --git a/charts/pulsar/templates/bookkeeper-podmonitor.yaml 
b/charts/pulsar/templates/bookkeeper-podmonitor.yaml
index a85441b..f2c41bc 100644
--- a/charts/pulsar/templates/bookkeeper-podmonitor.yaml
+++ b/charts/pulsar/templates/bookkeeper-podmonitor.yaml
@@ -48,6 +48,9 @@ spec:
         - sourceLabels: [__meta_kubernetes_pod_name]
           action: replace
           targetLabel: kubernetes_pod_name
+    {{- if $.Values.bookkeeper.podMonitor.metricRelabelings }}
+      metricRelabelings: {{ toYaml 
$.Values.bookkeeper.podMonitor.metricRelabelings | nindent 8 }}
+    {{- end }}
   selector:
     matchLabels:
       {{- include "pulsar.matchLabels" . | nindent 6 }}
diff --git a/charts/pulsar/templates/broker-podmonitor.yaml 
b/charts/pulsar/templates/broker-podmonitor.yaml
index 9ea0c4c..5d424ac 100644
--- a/charts/pulsar/templates/broker-podmonitor.yaml
+++ b/charts/pulsar/templates/broker-podmonitor.yaml
@@ -48,6 +48,9 @@ spec:
         - sourceLabels: [__meta_kubernetes_pod_name]
           action: replace
           targetLabel: kubernetes_pod_name
+    {{- if $.Values.broker.podMonitor.metricRelabelings }}
+      metricRelabelings: {{ toYaml 
$.Values.broker.podMonitor.metricRelabelings | nindent 8 }}
+    {{- end }}
   selector:
     matchLabels:
       {{- include "pulsar.matchLabels" . | nindent 6 }}
diff --git a/charts/pulsar/templates/proxy-podmonitor.yaml 
b/charts/pulsar/templates/proxy-podmonitor.yaml
index 66020dc..4823bd2 100644
--- a/charts/pulsar/templates/proxy-podmonitor.yaml
+++ b/charts/pulsar/templates/proxy-podmonitor.yaml
@@ -48,6 +48,9 @@ spec:
         - sourceLabels: [__meta_kubernetes_pod_name]
           action: replace
           targetLabel: kubernetes_pod_name
+    {{- if $.Values.proxy.podMonitor.metricRelabelings }}
+      metricRelabelings: {{ toYaml $.Values.proxy.podMonitor.metricRelabelings 
| nindent 8 }}
+    {{- end }}
   selector:
     matchLabels:
       {{- include "pulsar.matchLabels" . | nindent 6 }}
diff --git a/charts/pulsar/templates/zookeeper-podmonitor.yaml 
b/charts/pulsar/templates/zookeeper-podmonitor.yaml
index 8da13eb..f2de68b 100644
--- a/charts/pulsar/templates/zookeeper-podmonitor.yaml
+++ b/charts/pulsar/templates/zookeeper-podmonitor.yaml
@@ -48,6 +48,9 @@ spec:
         - sourceLabels: [__meta_kubernetes_pod_name]
           action: replace
           targetLabel: kubernetes_pod_name
+    {{- if $.Values.zookeeper.podMonitor.metricRelabelings }}
+      metricRelabelings: {{ toYaml 
$.Values.zookeeper.podMonitor.metricRelabelings | nindent 8 }}
+    {{- end }}
   selector:
     matchLabels:
       {{- include "pulsar.matchLabels" . | nindent 6 }}
diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml
index 505ed47..87bb608 100644
--- a/charts/pulsar/values.yaml
+++ b/charts/pulsar/values.yaml
@@ -290,6 +290,9 @@ zookeeper:
     enabled: true
     interval: 10s
     scrapeTimeout: 10s
+    metricRelabelings:
+      # - action: labeldrop
+      #   regex: cluster
   # True includes annotation for statefulset that contains hash of 
corresponding configmap, which will cause pods to restart on configmap change
   restartPodsOnConfigMapChange: false
   ports:
@@ -436,6 +439,9 @@ bookkeeper:
     enabled: true
     interval: 10s
     scrapeTimeout: 10s
+    metricRelabelings:
+      # - action: labeldrop
+      #   regex: cluster
   # True includes annotation for statefulset that contains hash of 
corresponding configmap, which will cause pods to restart on configmap change
   restartPodsOnConfigMapChange: false
   ports:
@@ -617,6 +623,9 @@ autorecovery:
     enabled: true
     interval: 10s
     scrapeTimeout: 10s
+    metricRelabelings:
+      # - action: labeldrop
+      #   regex: cluster
   # True includes annotation for statefulset that contains hash of 
corresponding configmap, which will cause pods to restart on configmap change
   restartPodsOnConfigMapChange: false
   ports:
@@ -704,6 +713,9 @@ broker:
     enabled: true
     interval: 10s
     scrapeTimeout: 10s
+    metricRelabelings:
+      # - action: labeldrop
+      #   regex: cluster
   # True includes annotation for statefulset that contains hash of 
corresponding configmap, which will cause pods to restart on configmap change
   restartPodsOnConfigMapChange: false
   ports:
@@ -843,6 +855,9 @@ proxy:
     enabled: true
     interval: 10s
     scrapeTimeout: 10s
+    metricRelabelings:
+      # - action: labeldrop
+      #   regex: cluster
   # True includes annotation for statefulset that contains hash of 
corresponding configmap, which will cause pods to restart on configmap change
   restartPodsOnConfigMapChange: false
   # nodeSelector:

Reply via email to