From f782d966a5034fb91daedb557423405eb55bb4d6 Mon Sep 17 00:00:00 2001 From: Toni Tauro Date: Thu, 29 Aug 2024 08:39:01 +0200 Subject: [PATCH] feat(serviceMonitors): add option of additional Labels in serviceMonitor Signed-off-by: Toni Tauro --- charts/opensearch-dashboards/Chart.yaml | 2 +- charts/opensearch-dashboards/templates/serviceMonitor.yaml | 3 +++ charts/opensearch-dashboards/values.yaml | 3 +++ charts/opensearch/Chart.yaml | 2 +- charts/opensearch/templates/serviceMonitor.yaml | 3 +++ charts/opensearch/values.yaml | 3 +++ 6 files changed, 14 insertions(+), 2 deletions(-) diff --git a/charts/opensearch-dashboards/Chart.yaml b/charts/opensearch-dashboards/Chart.yaml index 89a75405..0656aab5 100644 --- a/charts/opensearch-dashboards/Chart.yaml +++ b/charts/opensearch-dashboards/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 2.21.1 +version: 2.22.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/opensearch-dashboards/templates/serviceMonitor.yaml b/charts/opensearch-dashboards/templates/serviceMonitor.yaml index 1f1a2111..ae92805a 100644 --- a/charts/opensearch-dashboards/templates/serviceMonitor.yaml +++ b/charts/opensearch-dashboards/templates/serviceMonitor.yaml @@ -6,6 +6,9 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{- include "opensearch-dashboards.labels" . | nindent 4 }} + {{- with .Values.serviceMonitor.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: selector: matchLabels: diff --git a/charts/opensearch-dashboards/values.yaml b/charts/opensearch-dashboards/values.yaml index da2494d3..c2df2577 100644 --- a/charts/opensearch-dashboards/values.yaml +++ b/charts/opensearch-dashboards/values.yaml @@ -292,3 +292,6 @@ serviceMonitor: # Frequency at which Prometheus will scrape metrics. # Modify as needed for your monitoring requirements. interval: 10s + + # additional labels to be added to the ServiceMonitor + labels: {} diff --git a/charts/opensearch/Chart.yaml b/charts/opensearch/Chart.yaml index ba7c8342..66879da1 100644 --- a/charts/opensearch/Chart.yaml +++ b/charts/opensearch/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 2.23.1 +version: 2.24.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/opensearch/templates/serviceMonitor.yaml b/charts/opensearch/templates/serviceMonitor.yaml index 46b324e5..79837932 100644 --- a/charts/opensearch/templates/serviceMonitor.yaml +++ b/charts/opensearch/templates/serviceMonitor.yaml @@ -6,6 +6,9 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{- include "opensearch.labels" . | nindent 4 }} + {{- with .Values.serviceMonitor.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: selector: matchLabels: diff --git a/charts/opensearch/values.yaml b/charts/opensearch/values.yaml index ec8d4578..36fe2acc 100644 --- a/charts/opensearch/values.yaml +++ b/charts/opensearch/values.yaml @@ -543,3 +543,6 @@ serviceMonitor: # Frequency at which Prometheus will scrape metrics. # Adjust based on your needs. interval: 10s + + # additional labels to be added to the ServiceMonitor + labels: {}