From 61d85a64fd66ee7b6fd66d7f9e85d85bd88a1a41 Mon Sep 17 00:00:00 2001 From: Firas Mosbehi Date: Fri, 6 Mar 2026 10:33:31 +0100 Subject: [PATCH] prometheus-blackbox-exporter: use namespace metadata label in networkPolicy Signed-off-by: Firas Mosbehi --- charts/prometheus-blackbox-exporter/Chart.yaml | 2 +- .../prometheus-blackbox-exporter/templates/networkpolicy.yaml | 3 +-- charts/prometheus-blackbox-exporter/values.yaml | 3 ++- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/prometheus-blackbox-exporter/Chart.yaml b/charts/prometheus-blackbox-exporter/Chart.yaml index e5f305dcca57..8e704026724c 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: 11.8.0 +version: 11.8.1 # renovate: github=prometheus/blackbox_exporter appVersion: v0.28.0 kubeVersion: ">=1.21.0-0" diff --git a/charts/prometheus-blackbox-exporter/templates/networkpolicy.yaml b/charts/prometheus-blackbox-exporter/templates/networkpolicy.yaml index f96a57000177..883bff95e278 100644 --- a/charts/prometheus-blackbox-exporter/templates/networkpolicy.yaml +++ b/charts/prometheus-blackbox-exporter/templates/networkpolicy.yaml @@ -15,7 +15,7 @@ spec: - from: - namespaceSelector: matchLabels: - name: {{ .Values.networkPolicy.monitoringNamespaceName }} + kubernetes.io/metadata.name: {{ .Values.networkPolicy.monitoringNamespaceName }} ports: - port: {{ .Values.service.port }} protocol: TCP @@ -25,4 +25,3 @@ spec: policyTypes: - Ingress {{- end }} - diff --git a/charts/prometheus-blackbox-exporter/values.yaml b/charts/prometheus-blackbox-exporter/values.yaml index d4787a6fcd03..1015b6a0c959 100644 --- a/charts/prometheus-blackbox-exporter/values.yaml +++ b/charts/prometheus-blackbox-exporter/values.yaml @@ -384,7 +384,8 @@ networkPolicy: # Enable network policy and allow access from anywhere enabled: false # Limit access only from monitoring namespace - # Before setting this value to true, you must add the name=monitoring label to the monitoring namespace. Name can be rewritten by monitoringNamespaceName + # Before setting this value to true, the monitoring namespace must exist with + # kubernetes.io/metadata.name matching monitoringNamespaceName. # Network Policy uses label filtering allowMonitoringNamespace: false # Rewrite monitoring namespace in network policy (default value monitoring)