From 610516a4b14a41d5b36ce94ceb0c8c8beddcca27 Mon Sep 17 00:00:00 2001 From: Serhii Shepel Date: Wed, 3 Apr 2024 01:18:28 +0300 Subject: [PATCH] feat(chart): add custom label support for ServiceMonitor in DataHub charts This update allows the specification of custom labels for ServiceMonitor resources via the values.yaml file, mirroring the functionality already present for Service and Deployment resources. This enhancement facilitates better integration with monitoring systems like Prometheus that rely on specific labeling conventions for service discovery. Resolves: #449 --- .../subcharts/datahub-frontend/templates/servicemonitor.yaml | 4 ++-- .../subcharts/datahub-gms/templates/servicemonitor.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/datahub/subcharts/datahub-frontend/templates/servicemonitor.yaml b/charts/datahub/subcharts/datahub-frontend/templates/servicemonitor.yaml index 0c5ae6cd1..44455da3e 100644 --- a/charts/datahub/subcharts/datahub-frontend/templates/servicemonitor.yaml +++ b/charts/datahub/subcharts/datahub-frontend/templates/servicemonitor.yaml @@ -5,9 +5,9 @@ metadata: name: {{ printf "%s-%s" .Release.Name "datahub-frontend" }} labels: {{- include "datahub-frontend.labels" . | nindent 4 }} - {{ - range $key, $val := .Values.serviceMonitor.extraLabels }} + {{- range $key, $val := .Values.serviceMonitor.extraLabels }} {{ $key }}: {{ $val | quote }} - {{ - end }} + {{- end }} {{- with .Values.serviceMonitor.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/charts/datahub/subcharts/datahub-gms/templates/servicemonitor.yaml b/charts/datahub/subcharts/datahub-gms/templates/servicemonitor.yaml index 7c0daa72a..b8e5bf922 100644 --- a/charts/datahub/subcharts/datahub-gms/templates/servicemonitor.yaml +++ b/charts/datahub/subcharts/datahub-gms/templates/servicemonitor.yaml @@ -5,9 +5,9 @@ metadata: name: {{ printf "%s-%s" .Release.Name "datahub-gms" }} labels: {{- include "datahub-gms.labels" . | nindent 4 }} - {{ - range $key, $val := .Values.serviceMonitor.extraLabels }} + {{- range $key, $val := .Values.serviceMonitor.extraLabels }} {{ $key }}: {{ $val | quote }} - {{ - end }} + {{- end }} {{- with .Values.serviceMonitor.annotations }} annotations: {{- toYaml . | nindent 4 }}