From a89a5cfa2efd365cfc1c501c7055a315949c5f97 Mon Sep 17 00:00:00 2001 From: Brad McCoy Date: Tue, 2 May 2023 17:58:39 +1000 Subject: [PATCH] feat: add additionalLabels to Service Monitor (#366) * feat: add additionalLabels to Service Monitor Signed-off-by: Brad McCoy * feat: update additionalLabels Signed-off-by: Brad McCoy --------- Signed-off-by: Brad McCoy --- charts/k8sgpt/templates/serviceMonitor.yaml | 3 +++ charts/k8sgpt/values.yaml | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/charts/k8sgpt/templates/serviceMonitor.yaml b/charts/k8sgpt/templates/serviceMonitor.yaml index bcee7053f9..9e4a0ba2d3 100644 --- a/charts/k8sgpt/templates/serviceMonitor.yaml +++ b/charts/k8sgpt/templates/serviceMonitor.yaml @@ -6,6 +6,9 @@ metadata: namespace: {{ .Release.Namespace | quote }} labels: {{- include "k8sgpt.labels" . | nindent 4 }} + {{- if .Values.serviceMonitor.additionalLabels }} + {{- toYaml .Values.serviceMonitor.additionalLabels | nindent 4 }} + {{- end }} spec: endpoints: - honorLabels: true diff --git a/charts/k8sgpt/values.yaml b/charts/k8sgpt/values.yaml index 4f199a7101..ed855a2d6b 100644 --- a/charts/k8sgpt/values.yaml +++ b/charts/k8sgpt/values.yaml @@ -23,4 +23,5 @@ service: annotations: {} serviceMonitor: - enabled: false \ No newline at end of file + enabled: false + additionalLabels: {}