From a46e49751065882becbe9e0f34ba68ac1538a5ec Mon Sep 17 00:00:00 2001 From: Martin Burgos Date: Fri, 3 Oct 2025 13:07:25 +0200 Subject: [PATCH 1/2] Adding commonLabels functionality that adds labels to all Signed-off-by: Martin Burgos --- charts/prometheus-cloudwatch-exporter/Chart.yaml | 2 +- .../prometheus-cloudwatch-exporter/templates/_helpers.tpl | 6 ++++++ .../templates/clusterrole.yaml | 1 + .../templates/clusterrolebinding.yaml | 1 + .../templates/configmap.yaml | 1 + .../templates/deployment.yaml | 2 ++ .../prometheus-cloudwatch-exporter/templates/ingress.yaml | 1 + charts/prometheus-cloudwatch-exporter/templates/pdb.yaml | 1 + .../templates/prometheusrule.yaml | 7 ++++--- .../prometheus-cloudwatch-exporter/templates/secrets.yaml | 1 + .../prometheus-cloudwatch-exporter/templates/service.yaml | 1 + .../templates/serviceaccount.yaml | 1 + .../templates/servicemonitor.yaml | 7 ++++--- charts/prometheus-cloudwatch-exporter/values.yaml | 3 +++ 14 files changed, 28 insertions(+), 7 deletions(-) diff --git a/charts/prometheus-cloudwatch-exporter/Chart.yaml b/charts/prometheus-cloudwatch-exporter/Chart.yaml index 93f232c499af..d30ba9194de4 100644 --- a/charts/prometheus-cloudwatch-exporter/Chart.yaml +++ b/charts/prometheus-cloudwatch-exporter/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v1 -appVersion: "0.16.0" +appVersion: "0.17.0" description: A Helm chart for prometheus cloudwatch-exporter name: prometheus-cloudwatch-exporter version: 0.28.1 diff --git a/charts/prometheus-cloudwatch-exporter/templates/_helpers.tpl b/charts/prometheus-cloudwatch-exporter/templates/_helpers.tpl index c46dba657044..e38b233bd658 100644 --- a/charts/prometheus-cloudwatch-exporter/templates/_helpers.tpl +++ b/charts/prometheus-cloudwatch-exporter/templates/_helpers.tpl @@ -67,3 +67,9 @@ Return the appropriate apiVersion for rbac. {{- print "rbac.authorization.k8s.io/v1beta1" -}} {{- end -}} {{- end -}} + +{{- define "prometheus-cloudwatch-exporter.commonLabels" -}} +{{- if .Values.commonLabels }} +{{- toYaml .Values.commonLabels | nindent 0 -}} +{{- end }} +{{- end -}} \ No newline at end of file diff --git a/charts/prometheus-cloudwatch-exporter/templates/clusterrole.yaml b/charts/prometheus-cloudwatch-exporter/templates/clusterrole.yaml index 9afa3037a4e2..a47a2b0b544d 100644 --- a/charts/prometheus-cloudwatch-exporter/templates/clusterrole.yaml +++ b/charts/prometheus-cloudwatch-exporter/templates/clusterrole.yaml @@ -8,6 +8,7 @@ metadata: chart: {{ template "prometheus-cloudwatch-exporter.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- include "prometheus-cloudwatch-exporter.commonLabels" . | nindent 4 }} rules: - apiGroups: [""] resources: ["secrets","configmap"] diff --git a/charts/prometheus-cloudwatch-exporter/templates/clusterrolebinding.yaml b/charts/prometheus-cloudwatch-exporter/templates/clusterrolebinding.yaml index d9708e7ab6f3..5b42ab0784dd 100644 --- a/charts/prometheus-cloudwatch-exporter/templates/clusterrolebinding.yaml +++ b/charts/prometheus-cloudwatch-exporter/templates/clusterrolebinding.yaml @@ -8,6 +8,7 @@ metadata: chart: {{ template "prometheus-cloudwatch-exporter.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- include "prometheus-cloudwatch-exporter.commonLabels" . | nindent 4 }} subjects: - kind: ServiceAccount name: {{ template "prometheus-cloudwatch-exporter.serviceAccountName" . }} diff --git a/charts/prometheus-cloudwatch-exporter/templates/configmap.yaml b/charts/prometheus-cloudwatch-exporter/templates/configmap.yaml index fa2699df3de6..087545cc8615 100644 --- a/charts/prometheus-cloudwatch-exporter/templates/configmap.yaml +++ b/charts/prometheus-cloudwatch-exporter/templates/configmap.yaml @@ -8,6 +8,7 @@ metadata: chart: {{ template "prometheus-cloudwatch-exporter.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- include "prometheus-cloudwatch-exporter.commonLabels" . | nindent 4 }} data: config.yml: | {{ tpl .Values.config . | nindent 4 }} diff --git a/charts/prometheus-cloudwatch-exporter/templates/deployment.yaml b/charts/prometheus-cloudwatch-exporter/templates/deployment.yaml index 35544066f49a..765ad286f377 100644 --- a/charts/prometheus-cloudwatch-exporter/templates/deployment.yaml +++ b/charts/prometheus-cloudwatch-exporter/templates/deployment.yaml @@ -8,6 +8,7 @@ metadata: chart: {{ template "prometheus-cloudwatch-exporter.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- include "prometheus-cloudwatch-exporter.commonLabels" . | nindent 4 }} {{- with .Values.deployment.labels }} {{- toYaml . | nindent 4 }} {{- end }} @@ -26,6 +27,7 @@ spec: labels: app: {{ template "prometheus-cloudwatch-exporter.name" . }} release: {{ .Release.Name }} + {{- include "prometheus-cloudwatch-exporter.commonLabels" . | nindent 4 }} {{- if .Values.pod.labels }} {{ toYaml .Values.pod.labels | indent 8 }} {{- end }} diff --git a/charts/prometheus-cloudwatch-exporter/templates/ingress.yaml b/charts/prometheus-cloudwatch-exporter/templates/ingress.yaml index c58cf427e465..49e300d08da0 100644 --- a/charts/prometheus-cloudwatch-exporter/templates/ingress.yaml +++ b/charts/prometheus-cloudwatch-exporter/templates/ingress.yaml @@ -13,6 +13,7 @@ metadata: chart: {{ template "prometheus-cloudwatch-exporter.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- include "prometheus-cloudwatch-exporter.commonLabels" . | nindent 4 }} {{- if .Values.ingress.labels }} {{ toYaml .Values.ingress.labels | indent 4 }} {{- end }} diff --git a/charts/prometheus-cloudwatch-exporter/templates/pdb.yaml b/charts/prometheus-cloudwatch-exporter/templates/pdb.yaml index 7a88ca5c6ed1..0766cb3a214b 100644 --- a/charts/prometheus-cloudwatch-exporter/templates/pdb.yaml +++ b/charts/prometheus-cloudwatch-exporter/templates/pdb.yaml @@ -9,6 +9,7 @@ metadata: chart: {{ template "prometheus-cloudwatch-exporter.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- include "prometheus-cloudwatch-exporter.commonLabels" . | nindent 4 }} spec: {{- if .Values.podDisruptionBudget.minAvailable }} minAvailable: {{ .Values.podDisruptionBudget.minAvailable }} diff --git a/charts/prometheus-cloudwatch-exporter/templates/prometheusrule.yaml b/charts/prometheus-cloudwatch-exporter/templates/prometheusrule.yaml index e0c0b8e44ce9..86100beaf56d 100644 --- a/charts/prometheus-cloudwatch-exporter/templates/prometheusrule.yaml +++ b/charts/prometheus-cloudwatch-exporter/templates/prometheusrule.yaml @@ -3,10 +3,11 @@ apiVersion: monitoring.coreos.com/v1 kind: PrometheusRule metadata: -{{- if .Values.prometheusRule.labels }} labels: -{{ toYaml .Values.prometheusRule.labels | indent 4}} -{{- end }} + {{- if .Values.prometheusRule.labels }} + {{ toYaml .Values.prometheusRule.labels | nindent 4 }} + {{- end }} + {{- include "prometheus-cloudwatch-exporter.commonLabels" . | nindent 4 }} name: {{ $fullName }} {{- if .Values.prometheusRule.namespace }} namespace: {{ .Values.prometheusRule.namespace }} diff --git a/charts/prometheus-cloudwatch-exporter/templates/secrets.yaml b/charts/prometheus-cloudwatch-exporter/templates/secrets.yaml index 7309b4d4fbe6..34f2bd0f0adb 100644 --- a/charts/prometheus-cloudwatch-exporter/templates/secrets.yaml +++ b/charts/prometheus-cloudwatch-exporter/templates/secrets.yaml @@ -9,6 +9,7 @@ metadata: chart: {{ template "prometheus-cloudwatch-exporter.chart" . }} heritage: {{ .Release.Service }} release: {{ .Release.Name }} + {{- include "prometheus-cloudwatch-exporter.commonLabels" . | nindent 4 }} type: Opaque data: {{ if .Values.aws.aws_access_key_id }} diff --git a/charts/prometheus-cloudwatch-exporter/templates/service.yaml b/charts/prometheus-cloudwatch-exporter/templates/service.yaml index 6fb1b125475d..4a3c710242de 100644 --- a/charts/prometheus-cloudwatch-exporter/templates/service.yaml +++ b/charts/prometheus-cloudwatch-exporter/templates/service.yaml @@ -10,6 +10,7 @@ metadata: chart: {{ template "prometheus-cloudwatch-exporter.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- include "prometheus-cloudwatch-exporter.commonLabels" . | nindent 4 }} {{- if .Values.service.labels }} {{ toYaml .Values.service.labels | indent 4 }} {{- end }} diff --git a/charts/prometheus-cloudwatch-exporter/templates/serviceaccount.yaml b/charts/prometheus-cloudwatch-exporter/templates/serviceaccount.yaml index 7eb7cf75ed7e..5dbe959774ad 100644 --- a/charts/prometheus-cloudwatch-exporter/templates/serviceaccount.yaml +++ b/charts/prometheus-cloudwatch-exporter/templates/serviceaccount.yaml @@ -10,6 +10,7 @@ metadata: chart: {{ template "prometheus-cloudwatch-exporter.chart" . }} release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" + {{- include "prometheus-cloudwatch-exporter.commonLabels" . | nindent 4 }} {{- if .Values.serviceAccount.annotations }} annotations: {{ toYaml .Values.serviceAccount.annotations | nindent 4 }} diff --git a/charts/prometheus-cloudwatch-exporter/templates/servicemonitor.yaml b/charts/prometheus-cloudwatch-exporter/templates/servicemonitor.yaml index ed9234f34fa0..8d6cd6b258f5 100644 --- a/charts/prometheus-cloudwatch-exporter/templates/servicemonitor.yaml +++ b/charts/prometheus-cloudwatch-exporter/templates/servicemonitor.yaml @@ -2,10 +2,11 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: -{{- if .Values.serviceMonitor.labels }} labels: -{{ toYaml .Values.serviceMonitor.labels | indent 4}} -{{- end }} + {{- if .Values.serviceMonitor.labels }} + {{ toYaml .Values.serviceMonitor.labels | nindent 4}} + {{- end }} + {{- include "prometheus-cloudwatch-exporter.commonLabels" . | nindent 4 }} name: {{ template "prometheus-cloudwatch-exporter.fullname" . }} {{- if .Values.serviceMonitor.namespace }} namespace: {{ .Values.serviceMonitor.namespace }} diff --git a/charts/prometheus-cloudwatch-exporter/values.yaml b/charts/prometheus-cloudwatch-exporter/values.yaml index 2353ea73568a..9672f6f49dc8 100644 --- a/charts/prometheus-cloudwatch-exporter/values.yaml +++ b/charts/prometheus-cloudwatch-exporter/values.yaml @@ -2,6 +2,9 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. +# Adding labels to all K8S resources +commonLabels: {} + replicaCount: 1 image: From d8e124fd84821626ae026b71be701755fd08ea20 Mon Sep 17 00:00:00 2001 From: Martin Burgos Date: Fri, 3 Oct 2025 13:49:56 +0200 Subject: [PATCH 2/2] Correcting commonLabels Signed-off-by: Martin Burgos --- .../prometheus-cloudwatch-exporter/templates/_helpers.tpl | 6 ------ .../templates/clusterrole.yaml | 4 +++- .../templates/clusterrolebinding.yaml | 4 +++- .../templates/configmap.yaml | 4 +++- .../templates/deployment.yaml | 8 ++++++-- .../prometheus-cloudwatch-exporter/templates/ingress.yaml | 4 +++- charts/prometheus-cloudwatch-exporter/templates/pdb.yaml | 4 +++- .../templates/prometheusrule.yaml | 4 +++- .../prometheus-cloudwatch-exporter/templates/secrets.yaml | 4 +++- .../prometheus-cloudwatch-exporter/templates/service.yaml | 4 +++- .../templates/serviceaccount.yaml | 4 +++- .../templates/servicemonitor.yaml | 4 +++- 12 files changed, 36 insertions(+), 18 deletions(-) diff --git a/charts/prometheus-cloudwatch-exporter/templates/_helpers.tpl b/charts/prometheus-cloudwatch-exporter/templates/_helpers.tpl index e38b233bd658..c46dba657044 100644 --- a/charts/prometheus-cloudwatch-exporter/templates/_helpers.tpl +++ b/charts/prometheus-cloudwatch-exporter/templates/_helpers.tpl @@ -67,9 +67,3 @@ Return the appropriate apiVersion for rbac. {{- print "rbac.authorization.k8s.io/v1beta1" -}} {{- end -}} {{- end -}} - -{{- define "prometheus-cloudwatch-exporter.commonLabels" -}} -{{- if .Values.commonLabels }} -{{- toYaml .Values.commonLabels | nindent 0 -}} -{{- end }} -{{- end -}} \ No newline at end of file diff --git a/charts/prometheus-cloudwatch-exporter/templates/clusterrole.yaml b/charts/prometheus-cloudwatch-exporter/templates/clusterrole.yaml index a47a2b0b544d..7d4067ac87a3 100644 --- a/charts/prometheus-cloudwatch-exporter/templates/clusterrole.yaml +++ b/charts/prometheus-cloudwatch-exporter/templates/clusterrole.yaml @@ -8,7 +8,9 @@ metadata: chart: {{ template "prometheus-cloudwatch-exporter.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} - {{- include "prometheus-cloudwatch-exporter.commonLabels" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- toYaml .Values.commonLabels | nindent 4 -}} + {{- end }} rules: - apiGroups: [""] resources: ["secrets","configmap"] diff --git a/charts/prometheus-cloudwatch-exporter/templates/clusterrolebinding.yaml b/charts/prometheus-cloudwatch-exporter/templates/clusterrolebinding.yaml index 5b42ab0784dd..a0a5084bbf9f 100644 --- a/charts/prometheus-cloudwatch-exporter/templates/clusterrolebinding.yaml +++ b/charts/prometheus-cloudwatch-exporter/templates/clusterrolebinding.yaml @@ -8,7 +8,9 @@ metadata: chart: {{ template "prometheus-cloudwatch-exporter.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} - {{- include "prometheus-cloudwatch-exporter.commonLabels" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- toYaml .Values.commonLabels | nindent 4 -}} + {{- end }} subjects: - kind: ServiceAccount name: {{ template "prometheus-cloudwatch-exporter.serviceAccountName" . }} diff --git a/charts/prometheus-cloudwatch-exporter/templates/configmap.yaml b/charts/prometheus-cloudwatch-exporter/templates/configmap.yaml index 087545cc8615..eb01a53a6346 100644 --- a/charts/prometheus-cloudwatch-exporter/templates/configmap.yaml +++ b/charts/prometheus-cloudwatch-exporter/templates/configmap.yaml @@ -8,7 +8,9 @@ metadata: chart: {{ template "prometheus-cloudwatch-exporter.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} - {{- include "prometheus-cloudwatch-exporter.commonLabels" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- toYaml .Values.commonLabels | nindent 4 -}} + {{- end }} data: config.yml: | {{ tpl .Values.config . | nindent 4 }} diff --git a/charts/prometheus-cloudwatch-exporter/templates/deployment.yaml b/charts/prometheus-cloudwatch-exporter/templates/deployment.yaml index 765ad286f377..043f808117cb 100644 --- a/charts/prometheus-cloudwatch-exporter/templates/deployment.yaml +++ b/charts/prometheus-cloudwatch-exporter/templates/deployment.yaml @@ -8,7 +8,9 @@ metadata: chart: {{ template "prometheus-cloudwatch-exporter.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} - {{- include "prometheus-cloudwatch-exporter.commonLabels" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- toYaml .Values.commonLabels | nindent 4 -}} + {{- end }} {{- with .Values.deployment.labels }} {{- toYaml . | nindent 4 }} {{- end }} @@ -27,7 +29,9 @@ spec: labels: app: {{ template "prometheus-cloudwatch-exporter.name" . }} release: {{ .Release.Name }} - {{- include "prometheus-cloudwatch-exporter.commonLabels" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- toYaml .Values.commonLabels | nindent 8 -}} + {{- end }} {{- if .Values.pod.labels }} {{ toYaml .Values.pod.labels | indent 8 }} {{- end }} diff --git a/charts/prometheus-cloudwatch-exporter/templates/ingress.yaml b/charts/prometheus-cloudwatch-exporter/templates/ingress.yaml index 49e300d08da0..d441c0295f90 100644 --- a/charts/prometheus-cloudwatch-exporter/templates/ingress.yaml +++ b/charts/prometheus-cloudwatch-exporter/templates/ingress.yaml @@ -13,7 +13,9 @@ metadata: chart: {{ template "prometheus-cloudwatch-exporter.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} - {{- include "prometheus-cloudwatch-exporter.commonLabels" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- toYaml .Values.commonLabels | nindent 4 -}} + {{- end }} {{- if .Values.ingress.labels }} {{ toYaml .Values.ingress.labels | indent 4 }} {{- end }} diff --git a/charts/prometheus-cloudwatch-exporter/templates/pdb.yaml b/charts/prometheus-cloudwatch-exporter/templates/pdb.yaml index 0766cb3a214b..1591fd685101 100644 --- a/charts/prometheus-cloudwatch-exporter/templates/pdb.yaml +++ b/charts/prometheus-cloudwatch-exporter/templates/pdb.yaml @@ -9,7 +9,9 @@ metadata: chart: {{ template "prometheus-cloudwatch-exporter.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} - {{- include "prometheus-cloudwatch-exporter.commonLabels" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- toYaml .Values.commonLabels | nindent 4 -}} + {{- end }} spec: {{- if .Values.podDisruptionBudget.minAvailable }} minAvailable: {{ .Values.podDisruptionBudget.minAvailable }} diff --git a/charts/prometheus-cloudwatch-exporter/templates/prometheusrule.yaml b/charts/prometheus-cloudwatch-exporter/templates/prometheusrule.yaml index 86100beaf56d..b6cad6e3e61d 100644 --- a/charts/prometheus-cloudwatch-exporter/templates/prometheusrule.yaml +++ b/charts/prometheus-cloudwatch-exporter/templates/prometheusrule.yaml @@ -7,7 +7,9 @@ metadata: {{- if .Values.prometheusRule.labels }} {{ toYaml .Values.prometheusRule.labels | nindent 4 }} {{- end }} - {{- include "prometheus-cloudwatch-exporter.commonLabels" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- toYaml .Values.commonLabels | nindent 4 -}} + {{- end }} name: {{ $fullName }} {{- if .Values.prometheusRule.namespace }} namespace: {{ .Values.prometheusRule.namespace }} diff --git a/charts/prometheus-cloudwatch-exporter/templates/secrets.yaml b/charts/prometheus-cloudwatch-exporter/templates/secrets.yaml index 34f2bd0f0adb..0548c1c770c1 100644 --- a/charts/prometheus-cloudwatch-exporter/templates/secrets.yaml +++ b/charts/prometheus-cloudwatch-exporter/templates/secrets.yaml @@ -9,7 +9,9 @@ metadata: chart: {{ template "prometheus-cloudwatch-exporter.chart" . }} heritage: {{ .Release.Service }} release: {{ .Release.Name }} - {{- include "prometheus-cloudwatch-exporter.commonLabels" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- toYaml .Values.commonLabels | nindent 4 -}} + {{- end }} type: Opaque data: {{ if .Values.aws.aws_access_key_id }} diff --git a/charts/prometheus-cloudwatch-exporter/templates/service.yaml b/charts/prometheus-cloudwatch-exporter/templates/service.yaml index 4a3c710242de..a67445423ecb 100644 --- a/charts/prometheus-cloudwatch-exporter/templates/service.yaml +++ b/charts/prometheus-cloudwatch-exporter/templates/service.yaml @@ -10,7 +10,9 @@ metadata: chart: {{ template "prometheus-cloudwatch-exporter.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} - {{- include "prometheus-cloudwatch-exporter.commonLabels" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- toYaml .Values.commonLabels | nindent 4 -}} + {{- end }} {{- if .Values.service.labels }} {{ toYaml .Values.service.labels | indent 4 }} {{- end }} diff --git a/charts/prometheus-cloudwatch-exporter/templates/serviceaccount.yaml b/charts/prometheus-cloudwatch-exporter/templates/serviceaccount.yaml index 5dbe959774ad..002c7fb32a09 100644 --- a/charts/prometheus-cloudwatch-exporter/templates/serviceaccount.yaml +++ b/charts/prometheus-cloudwatch-exporter/templates/serviceaccount.yaml @@ -10,7 +10,9 @@ metadata: chart: {{ template "prometheus-cloudwatch-exporter.chart" . }} release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" - {{- include "prometheus-cloudwatch-exporter.commonLabels" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- toYaml .Values.commonLabels | nindent 4 -}} + {{- end }} {{- if .Values.serviceAccount.annotations }} annotations: {{ toYaml .Values.serviceAccount.annotations | nindent 4 }} diff --git a/charts/prometheus-cloudwatch-exporter/templates/servicemonitor.yaml b/charts/prometheus-cloudwatch-exporter/templates/servicemonitor.yaml index 8d6cd6b258f5..eb22604c7c27 100644 --- a/charts/prometheus-cloudwatch-exporter/templates/servicemonitor.yaml +++ b/charts/prometheus-cloudwatch-exporter/templates/servicemonitor.yaml @@ -6,7 +6,9 @@ metadata: {{- if .Values.serviceMonitor.labels }} {{ toYaml .Values.serviceMonitor.labels | nindent 4}} {{- end }} - {{- include "prometheus-cloudwatch-exporter.commonLabels" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- toYaml .Values.commonLabels | nindent 4 -}} + {{- end }} name: {{ template "prometheus-cloudwatch-exporter.fullname" . }} {{- if .Values.serviceMonitor.namespace }} namespace: {{ .Values.serviceMonitor.namespace }}