Skip to content

Commit 3dad222

Browse files
feat(monitoring): add support for additional labels in PodMonitor configuration
Signed-off-by: Nelson Alfonso <[email protected]>
1 parent c8d18c9 commit 3dad222

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

charts/cluster/templates/cluster.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,5 +141,11 @@ spec:
141141
{{- toYaml . | nindent 6 }}
142142
{{ end }}
143143
{{- end }}
144+
{{- if not (empty .Values.cluster.monitoring.podMonitor.labels) }}
145+
{{- with .Values.cluster.monitoring.podMonitor.labels }}
146+
podMonitorAdditionalLabels:
147+
{{- toYaml . | nindent 6 }}
148+
{{ end }}
149+
{{- end }}
144150
{{ include "cluster.bootstrap" . | nindent 2 }}
145151
{{ include "cluster.backup" . | nindent 2 }}

charts/cluster/values.schema.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,9 @@
244244
"metricRelabelings": {
245245
"type": "array"
246246
},
247+
"labels": {
248+
"type": "object"
249+
},
247250
"relabelings": {
248251
"type": "array"
249252
}

charts/cluster/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,9 @@ cluster:
309309
podMonitor:
310310
# -- Whether to enable the PodMonitor
311311
enabled: true
312+
# -- Additional labels to set on the generated PodMonitor resource.
313+
# Add labels your monitoring stack requires (for example `team-name`).
314+
labels: {}
312315
# --The list of relabelings for the PodMonitor.
313316
# Applied to samples before scraping.
314317
relabelings: []

0 commit comments

Comments
 (0)