From d90b78d071295deb0e51edc50afc8d76377c9f04 Mon Sep 17 00:00:00 2001 From: "R.Sicart" Date: Fri, 10 Nov 2023 10:46:57 +0100 Subject: [PATCH] [prometheus-memcached-exporter] Fix: allow to configure extra labels and annotations for the Service (#3943) Signed-off-by: R.Sicart Signed-off-by: Sacha --- charts/prometheus-memcached-exporter/Chart.yaml | 2 +- .../prometheus-memcached-exporter/templates/service.yaml | 7 +++++++ charts/prometheus-memcached-exporter/values.yaml | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/charts/prometheus-memcached-exporter/Chart.yaml b/charts/prometheus-memcached-exporter/Chart.yaml index 992314eeb322..3a3e31f9f5b4 100644 --- a/charts/prometheus-memcached-exporter/Chart.yaml +++ b/charts/prometheus-memcached-exporter/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: prometheus-memcached-exporter description: Prometheus exporter for Memcached metrics type: application -version: 0.1.0 +version: 0.2.0 appVersion: "v0.13.0" home: https://github.com/prometheus/memcached_exporter sources: diff --git a/charts/prometheus-memcached-exporter/templates/service.yaml b/charts/prometheus-memcached-exporter/templates/service.yaml index 652f1a523c67..7b4dd41155b6 100644 --- a/charts/prometheus-memcached-exporter/templates/service.yaml +++ b/charts/prometheus-memcached-exporter/templates/service.yaml @@ -4,6 +4,13 @@ metadata: name: {{ include "prometheus-memcached-exporter.fullname" . }} labels: {{- include "prometheus-memcached-exporter.labels" . | nindent 4 }} + {{- with .Values.service.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.service.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} spec: type: {{ .Values.service.type }} ports: diff --git a/charts/prometheus-memcached-exporter/values.yaml b/charts/prometheus-memcached-exporter/values.yaml index 3c72a789ffd6..7dd55d1b1a09 100644 --- a/charts/prometheus-memcached-exporter/values.yaml +++ b/charts/prometheus-memcached-exporter/values.yaml @@ -39,6 +39,10 @@ securityContext: {} service: type: ClusterIP port: 9150 + # Labels to append to the service + labels: {} + # Annotations to add to the service + annotations: {} resources: {} # We usually recommend not to specify default resources and to leave this as a conscious