From 3a7c99f51a60bc00b6bf73b7a0bae97b6931c9c1 Mon Sep 17 00:00:00 2001 From: Justin S Date: Tue, 8 Aug 2023 09:35:07 -0400 Subject: [PATCH] Helm linkerd-controler-plane Allow Custom labels on Pod Monitor Need to be able to set labels on Pod Monitors add a labels section to podMonitor Helm Lint/Helm Template Fixes #[11175] Signed-off-by: Justin S --- charts/linkerd-control-plane/templates/podmonitor.yaml | 3 +++ charts/linkerd-control-plane/values.yaml | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/charts/linkerd-control-plane/templates/podmonitor.yaml b/charts/linkerd-control-plane/templates/podmonitor.yaml index 9dff7661d74d6..fd2b5d6ceb1dd 100644 --- a/charts/linkerd-control-plane/templates/podmonitor.yaml +++ b/charts/linkerd-control-plane/templates/podmonitor.yaml @@ -12,6 +12,7 @@ metadata: labels: linkerd.io/control-plane-ns: {{ .Release.Namespace }} {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }} + {{- with .Values.podMonitor.labels }}{{ toYaml . | trim | nindent 4 }}{{- end }} annotations: {{ include "partials.annotations.created-by" . }} spec: @@ -44,6 +45,7 @@ metadata: labels: linkerd.io/control-plane-ns: {{ .Release.Namespace }} {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }} + {{- with .Values.podMonitor.labels }}{{ toYaml . | trim | nindent 4 }}{{- end }} annotations: {{ include "partials.annotations.created-by" . }} spec: @@ -78,6 +80,7 @@ metadata: labels: linkerd.io/control-plane-ns: {{ .Release.Namespace }} {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }} + {{- with .Values.podMonitor.labels }}{{ toYaml . | trim | nindent 4 }}{{- end }} annotations: {{ include "partials.annotations.created-by" . }} spec: diff --git a/charts/linkerd-control-plane/values.yaml b/charts/linkerd-control-plane/values.yaml index ba1af7a904b6c..fcce4fb7abc8e 100644 --- a/charts/linkerd-control-plane/values.yaml +++ b/charts/linkerd-control-plane/values.yaml @@ -530,6 +530,8 @@ podMonitor: scrapeInterval: 10s # -- Iimeout after which the scrape is ended scrapeTimeout: 10s + # -- Labels to apply to all pod Monitors + labels: {} controller: # -- Enables the creation of PodMonitor for the control-plane enabled: true @@ -544,4 +546,4 @@ podMonitor: enabled: true proxy: # -- Enables the creation of PodMonitor for the data-plane - enabled: true + enabled: true \ No newline at end of file