From c4bd8ebd129abdf5f2ff9fe2bdac05eccb613948 Mon Sep 17 00:00:00 2001 From: SmokyZone Date: Mon, 2 Nov 2026 12:11:08 +0100 Subject: [PATCH] NetworkPolicy: ingress namespaces configurable, allow traefik (migration from ingress-nginx) Co-Authored-By: Claude Opus 5.5 --- templates/networkpolicy.yaml | 4 +++- values.yaml | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/templates/networkpolicy.yaml b/templates/networkpolicy.yaml index deceb20..f92acd4 100644 --- a/templates/networkpolicy.yaml +++ b/templates/networkpolicy.yaml @@ -29,9 +29,11 @@ spec: - Egress ingress: - from: + {{- range $root.Values.networkPolicy.ingressNamespaces }} - namespaceSelector: matchLabels: - kubernetes.io/metadata.name: ingress-nginx + kubernetes.io/metadata.name: {{ . }} + {{- end }} {{- range $app.networkPolicy.allowFrom }} - podSelector: matchLabels: diff --git a/values.yaml b/values.yaml index 49721ad..14d5fb3 100644 --- a/values.yaml +++ b/values.yaml @@ -59,6 +59,10 @@ ingress: storageClassName: "" networkPolicy: + # Namespaces of the ingress controller(s) allowed to reach isolated apps. + ingressNamespaces: + - ingress-nginx + - traefik # loki's addresses: kubelet probes and hostNetwork pods (Home Assistant) come from here. # 10.1.215.192 = vxlan.calico interface (host -> pod traffic may use it as source). nodeIPs: