Skip to content

Commit c54a54b

Browse files
committed
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 <apanatto@redhat.com>
1 parent fda7a9f commit c54a54b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

bindata/network/multus-networkpolicy/multus-networkpolicy.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ spec:
4141
- "--network-plugins=macvlan,sriov,ipvlan,bond"
4242
- "--custom-v6-ingress-rule-file=/etc/multi-networkpolicy/rules/custom-v6-rules.txt"
4343
- "--custom-v6-egress-rule-file=/etc/multi-networkpolicy/rules/custom-v6-rules.txt"
44+
- "--hostname=${K8S_NODE_NAME}"
45+
env:
46+
- name: K8S_NODE_NAME
47+
valueFrom:
48+
fieldRef:
49+
fieldPath: spec.nodeName
4450
resources:
4551
requests:
4652
cpu: "100m"

0 commit comments

Comments
 (0)