From 206e02d192b2b1ec2eaebc12defa924688dc51f7 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 9 Nov 2023 15:26:55 +0200 Subject: [PATCH] [kube-state-metrics] Add templating support in ServiceMonitor labels/annotations (#3975) Signed-off-by: birca --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/templates/servicemonitor.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 60a9975b7fd4..1bc7400d8a27 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -7,7 +7,7 @@ keywords: - prometheus - kubernetes type: application -version: 5.15.0 +version: 5.15.1 appVersion: 2.10.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/templates/servicemonitor.yaml b/charts/kube-state-metrics/templates/servicemonitor.yaml index 0a5b851eca9d..e2cde649ac5c 100644 --- a/charts/kube-state-metrics/templates/servicemonitor.yaml +++ b/charts/kube-state-metrics/templates/servicemonitor.yaml @@ -7,11 +7,11 @@ metadata: labels: {{- include "kube-state-metrics.labels" . | indent 4 }} {{- with .Values.prometheus.monitor.additionalLabels }} - {{- toYaml . | nindent 4 }} + {{- tpl (toYaml . | nindent 4) $ }} {{- end }} {{- with .Values.prometheus.monitor.annotations }} annotations: - {{- toYaml . | nindent 4 }} + {{- tpl (toYaml . | nindent 4) $ }} {{- end }} spec: jobLabel: {{ default "app.kubernetes.io/name" .Values.prometheus.monitor.jobLabel }}