Skip to content

Commit

Permalink
feat: add metricsRelabelings on podMonitor (#406)
Browse files Browse the repository at this point in the history
  • Loading branch information
lenglet-k authored Dec 21, 2023
1 parent a725188 commit eedc21d
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 0 deletions.
3 changes: 3 additions & 0 deletions charts/pulsar/templates/autorecovery-podmonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
3 changes: 3 additions & 0 deletions charts/pulsar/templates/bookkeeper-podmonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
3 changes: 3 additions & 0 deletions charts/pulsar/templates/broker-podmonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
3 changes: 3 additions & 0 deletions charts/pulsar/templates/proxy-podmonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
3 changes: 3 additions & 0 deletions charts/pulsar/templates/zookeeper-podmonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
15 changes: 15 additions & 0 deletions charts/pulsar/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit eedc21d

Please sign in to comment.