From 6d49f3bb21a76c31ddc674f0ce6be6d554fb45ed Mon Sep 17 00:00:00 2001 From: Justin Seiser Date: Fri, 15 Sep 2023 09:43:17 -0500 Subject: [PATCH] Helm linkerd-controler-plane Allow Custom labels on Pod Monitor (#11222) 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/README.md | 1 + charts/linkerd-control-plane/templates/podmonitor.yaml | 3 +++ charts/linkerd-control-plane/values.yaml | 2 ++ 3 files changed, 6 insertions(+) diff --git a/charts/linkerd-control-plane/README.md b/charts/linkerd-control-plane/README.md index d46fc2aef04f9..0a62966842fe8 100644 --- a/charts/linkerd-control-plane/README.md +++ b/charts/linkerd-control-plane/README.md @@ -197,6 +197,7 @@ Kubernetes: `>=1.21.0-0` | podMonitor.controller.enabled | bool | `true` | Enables the creation of PodMonitor for the control-plane | | podMonitor.controller.namespaceSelector | string | `"matchNames:\n - {{ .Release.Namespace }}\n - linkerd-viz\n - linkerd-jaeger\n"` | Selector to select which namespaces the Endpoints objects are discovered from | | podMonitor.enabled | bool | `false` | Enables the creation of Prometheus Operator [PodMonitor](https://prometheus-operator.dev/docs/operator/api/#monitoring.coreos.com/v1.PodMonitor) | +| podMonitor.labels | object | `{}` | Labels to apply to all pod Monitors | | podMonitor.proxy.enabled | bool | `true` | Enables the creation of PodMonitor for the data-plane | | podMonitor.scrapeInterval | string | `"10s"` | Interval at which metrics should be scraped | | podMonitor.scrapeTimeout | string | `"10s"` | Iimeout after which the scrape is ended | 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 c055b5bc57154..8a64cc9cec8cf 100644 --- a/charts/linkerd-control-plane/values.yaml +++ b/charts/linkerd-control-plane/values.yaml @@ -555,6 +555,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