From a4d1b975c37bfee8e5a3ea76f855ef6b65967e14 Mon Sep 17 00:00:00 2001 From: Andrea Panattoni Date: Mon, 17 Nov 2025 18:43:50 +0100 Subject: [PATCH] mnp: Set `hostname` using downward API MultusNetworkPolicy implementation default to `util.GetHostname` to know the name of the node it is running on and filter pods accordingly. In some cases, that information might be not accurate, leading to a wrong behavior of the controller. Use downward api to populate the `--hostname` argument of the multus network policy controller. Link: https://github.com/kubernetes/component-helpers/blob/v0.34.2/node/util/hostname.go#L28 Signed-off-by: Andrea Panattoni --- .../network/multus-networkpolicy/multus-networkpolicy.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bindata/network/multus-networkpolicy/multus-networkpolicy.yaml b/bindata/network/multus-networkpolicy/multus-networkpolicy.yaml index 1c993cf721..d75779b193 100644 --- a/bindata/network/multus-networkpolicy/multus-networkpolicy.yaml +++ b/bindata/network/multus-networkpolicy/multus-networkpolicy.yaml @@ -41,6 +41,12 @@ spec: - "--network-plugins=macvlan,sriov,ipvlan,bond" - "--custom-v6-ingress-rule-file=/etc/multi-networkpolicy/rules/custom-v6-rules.txt" - "--custom-v6-egress-rule-file=/etc/multi-networkpolicy/rules/custom-v6-rules.txt" + - "--hostname-override=$(K8S_NODE_NAME)" + env: + - name: K8S_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName resources: requests: cpu: "100m"