From 753186d218c4f3e4b5ce9cb18c2dc83829d9df67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Ho=C3=9F?= Date: Sat, 15 Feb 2025 10:05:19 +0100 Subject: [PATCH] [prometheus-blackbox-exporter] Add missing port names to ServiceMonitor endpoints MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since the port names are hardcoded in the service.yaml file, we can just reference them by name instead of templating their values. Signed-off-by: Sebastian Hoß --- charts/prometheus-blackbox-exporter/Chart.yaml | 2 +- .../ci/servicemonitor-values.yaml | 4 ++++ .../templates/selfservicemonitor.yaml | 5 ++--- charts/prometheus-blackbox-exporter/values.yaml | 2 -- 4 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 charts/prometheus-blackbox-exporter/ci/servicemonitor-values.yaml diff --git a/charts/prometheus-blackbox-exporter/Chart.yaml b/charts/prometheus-blackbox-exporter/Chart.yaml index 46e83a1ca12e..627b2dcce24b 100644 --- a/charts/prometheus-blackbox-exporter/Chart.yaml +++ b/charts/prometheus-blackbox-exporter/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 description: Prometheus Blackbox Exporter name: prometheus-blackbox-exporter -version: 9.2.0 +version: 9.2.1 appVersion: v0.25.0 kubeVersion: ">=1.21.0-0" home: https://github.com/prometheus/blackbox_exporter diff --git a/charts/prometheus-blackbox-exporter/ci/servicemonitor-values.yaml b/charts/prometheus-blackbox-exporter/ci/servicemonitor-values.yaml new file mode 100644 index 000000000000..0563f0f759f7 --- /dev/null +++ b/charts/prometheus-blackbox-exporter/ci/servicemonitor-values.yaml @@ -0,0 +1,4 @@ +serviceMonitor: + selfMonitor: + enabled: true + enabled: true diff --git a/charts/prometheus-blackbox-exporter/templates/selfservicemonitor.yaml b/charts/prometheus-blackbox-exporter/templates/selfservicemonitor.yaml index 61db72dac66c..e3aad4a66e1f 100644 --- a/charts/prometheus-blackbox-exporter/templates/selfservicemonitor.yaml +++ b/charts/prometheus-blackbox-exporter/templates/selfservicemonitor.yaml @@ -16,9 +16,7 @@ spec: interval: {{ .Values.serviceMonitor.selfMonitor.interval }} scrapeTimeout: {{ .Values.serviceMonitor.selfMonitor.scrapeTimeout }} scheme: {{ .Values.serviceMonitor.selfMonitor.scheme }} - {{- with .Values.serviceMonitor.selfMonitor.port }} - port: {{ . }} - {{- end }} + port: http {{- if .Values.serviceMonitor.selfMonitor.additionalMetricsRelabels }} metricRelabelings: {{- toYaml .Values.serviceMonitor.selfMonitor.additionalMetricsRelabels | nindent 6 }} @@ -36,6 +34,7 @@ spec: interval: {{ .Values.configReloader.serviceMonitor.selfMonitor.interval }} scrapeTimeout: {{ .Values.configReloader.serviceMonitor.selfMonitor.scrapeTimeout }} scheme: {{ .Values.configReloader.serviceMonitor.selfMonitor.scheme }} + port: reloader-web {{- if .Values.configReloader.serviceMonitor.selfMonitor.tlsConfig }} tlsConfig: {{- toYaml .Values.configReloader.serviceMonitor.selfMonitor.tlsConfig | nindent 6 }} diff --git a/charts/prometheus-blackbox-exporter/values.yaml b/charts/prometheus-blackbox-exporter/values.yaml index 6b068d32ea97..ac7c5f69997d 100644 --- a/charts/prometheus-blackbox-exporter/values.yaml +++ b/charts/prometheus-blackbox-exporter/values.yaml @@ -287,8 +287,6 @@ serviceMonitor: tlsConfig: {} interval: 30s scrapeTimeout: 30s - ## Port can be defined by assigning a value for the port key below - ## port: ## If true, a ServiceMonitor CRD is created for a prometheus operator ## https://github.com/coreos/prometheus-operator for each target