From 17785632d359468d59ac21f5f3ffc7e7c1560f0d Mon Sep 17 00:00:00 2001 From: Michal Skwierczynski Date: Mon, 12 Oct 2026 10:00:06 +0200 Subject: [PATCH] Changed ServiceMonitor discovery mechanism to role selector --- charts/core/Chart.yaml | 2 +- charts/core/templates/CRD/servicemonitor.yaml | 3 +++ charts/core/values.yaml | 2 +- charts/dotnet-core/Chart.yaml | 4 ++-- charts/dotnet-core/values.yaml | 2 +- charts/event-worker/Chart.yaml | 4 ++-- charts/event-worker/values.yaml | 1 + 7 files changed, 11 insertions(+), 7 deletions(-) diff --git a/charts/core/Chart.yaml b/charts/core/Chart.yaml index 676920d..d6d7600 100644 --- a/charts/core/Chart.yaml +++ b/charts/core/Chart.yaml @@ -2,4 +2,4 @@ apiVersion: v2 name: charts-core description: A Helm chart for Kubernetes type: application -version: 2.12.0 +version: 2.13.0 diff --git a/charts/core/templates/CRD/servicemonitor.yaml b/charts/core/templates/CRD/servicemonitor.yaml index d283c54..eb27d10 100644 --- a/charts/core/templates/CRD/servicemonitor.yaml +++ b/charts/core/templates/CRD/servicemonitor.yaml @@ -6,6 +6,9 @@ metadata: labels: app.kubernetes.io/name: {{ .Release.Name }} spec: + {{- if .Values.global.monitoring.servicemonitor.roleSelectorDiscoveryMechanism }} + selectorMechanism: RoleSelector + {{- end }} endpoints: - path: {{ .Values.global.monitoring.metrics.path }} targetPort: {{ .Values.global.monitoring.metrics.port }} diff --git a/charts/core/values.yaml b/charts/core/values.yaml index 0d95c41..4f1d3a8 100644 --- a/charts/core/values.yaml +++ b/charts/core/values.yaml @@ -137,7 +137,7 @@ global: path: /metrics servicemonitor: enabled: false # setting to enable or disable monitoring of service on endpoint /metrics. Service should support exporting metrics to that endpoint first - + roleSelectorDiscoveryMechanism: true # prometheus server settings for existing prometheus installation. Currently needed only for canary deployments. prometheusService: prometheus-operator-kube-p-prometheus prometheusPort: 9090 diff --git a/charts/dotnet-core/Chart.yaml b/charts/dotnet-core/Chart.yaml index f28b5dd..99e76c8 100644 --- a/charts/dotnet-core/Chart.yaml +++ b/charts/dotnet-core/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 description: EcoVadis Helm chart for .Net Core app name: charts-dotnet-core type: application -version: 4.14.0 +version: 4.15.0 dependencies: - name: charts-core - version: "2.12.0" + version: "2.13.0" repository: "https://ecovadiscode.github.io/charts/" \ No newline at end of file diff --git a/charts/dotnet-core/values.yaml b/charts/dotnet-core/values.yaml index 1125881..5c2dd96 100644 --- a/charts/dotnet-core/values.yaml +++ b/charts/dotnet-core/values.yaml @@ -212,7 +212,7 @@ global: path: /metrics servicemonitor: enabled: true # setting to enable or disable monitoring of service on endpoint /metrics. Service should support exporting metrics to that endpoint first. NOTE: global.monitoring.metrics should be enabled as well. - + roleSelectorDiscoveryMechanism: true # prometheus server settings for existing prometheus installation. Currently needed only for canary deployments. prometheusService: prometheus-operator-kube-p-prometheus prometheusPort: 9090 diff --git a/charts/event-worker/Chart.yaml b/charts/event-worker/Chart.yaml index c99b3af..d2067f9 100644 --- a/charts/event-worker/Chart.yaml +++ b/charts/event-worker/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 description: EcoVadis Helm chart for K8s Event driven Deployment name: charts-event-worker type: application -version: 1.10.0 +version: 1.11.0 dependencies: - name: charts-core - version: 2.12.0 + version: 2.13.0 repository: "https://ecovadiscode.github.io/charts/" \ No newline at end of file diff --git a/charts/event-worker/values.yaml b/charts/event-worker/values.yaml index ce467bc..833291d 100644 --- a/charts/event-worker/values.yaml +++ b/charts/event-worker/values.yaml @@ -145,6 +145,7 @@ global: path: /metrics servicemonitor: enabled: false # TODO: Change when worker.template will be updated + roleSelectorDiscoveryMechanism: true metricsServer: image: repository: "cicdcr01weuy01.azurecr.io"