From f6325240171c4a6d9a8b8f16d2989333f3734cd2 Mon Sep 17 00:00:00 2001 From: Tom George Date: Wed, 27 Nov 2024 14:48:12 -0500 Subject: [PATCH] [prometheus-artifactory-exporter] Allow setting additional labels on deployment and pods (#23) * Allow setting additional labels on deployment and pods - Adds `extraDeploymentLabels` that will add additional labels to the deployment - Adds `extraPodLabels` that will add additional labels on the pod * Update chart version * Fix linter error --- charts/prometheus-artifactory-exporter/Chart.yaml | 2 +- .../templates/deployment.yaml | 6 ++++++ charts/prometheus-artifactory-exporter/values.yaml | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/charts/prometheus-artifactory-exporter/Chart.yaml b/charts/prometheus-artifactory-exporter/Chart.yaml index cc2ab24..c57870d 100644 --- a/charts/prometheus-artifactory-exporter/Chart.yaml +++ b/charts/prometheus-artifactory-exporter/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: "1.14.0" description: A Helm chart for the Prometheus Artifactory Exporter name: prometheus-artifactory-exporter -version: 0.6.3 +version: 0.6.4 keywords: - metrics - artifactory diff --git a/charts/prometheus-artifactory-exporter/templates/deployment.yaml b/charts/prometheus-artifactory-exporter/templates/deployment.yaml index 4081c9c..acf5e98 100644 --- a/charts/prometheus-artifactory-exporter/templates/deployment.yaml +++ b/charts/prometheus-artifactory-exporter/templates/deployment.yaml @@ -7,6 +7,9 @@ metadata: chart: {{ template "prometheus-artifactory-exporter.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.extraDeploymentLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: replicas: {{ .Values.replicaCount }} selector: @@ -18,6 +21,9 @@ spec: labels: app: {{ template "prometheus-artifactory-exporter.name" . }} release: {{ .Release.Name }} + {{- with .Values.extraPodLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} {{- if .Values.podAnnotations }} annotations: {{ toYaml .Values.podAnnotations | nindent 8 }} diff --git a/charts/prometheus-artifactory-exporter/values.yaml b/charts/prometheus-artifactory-exporter/values.yaml index 80468d8..0698c7b 100644 --- a/charts/prometheus-artifactory-exporter/values.yaml +++ b/charts/prometheus-artifactory-exporter/values.yaml @@ -116,6 +116,12 @@ initContainers: [] # Extra containers for the exporter pod extraContainers: [] +# Extra labels for the exporter deployment +extraDeploymentLabels: {} + +# Extra labels for the exporter pod +extraPodLabels: {} + # Extra Volumes for the pod extraVolumes: [] # - name: example