Skip to content

Commit 08b8f08

Browse files
committed
Fix MetalLB L2Advertisement to use baremetal network interface only
1 parent 05f31ce commit 08b8f08

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

ci-operator/step-registry/hypershift/kubevirt/baremetalds/metallb/hypershift-kubevirt-baremetalds-metallb-commands.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ set -o errexit
55
set -o pipefail
66
set -x
77

8+
POOL_RANGE="192.168.111.30-192.168.111.50"
9+
10+
# Pin L2 announcements to the baremetal network interface only.
11+
# Without this, extra network interfaces (e.g. from nmstate) can cause
12+
# MetalLB speakers to announce VIPs on the wrong interface, making
13+
# LoadBalancer IPs unreachable from the infra cluster.
14+
# In OVN environments, the baremetal network (192.168.111.0/24) is on
15+
# br-ex (OVS external bridge), not on the raw NIC. enp1s0 is the
16+
# provisioning network (172.22.0.0/24), enp2s0 is consumed by OVS.
17+
METALLB_IFACE="br-ex"
18+
819
oc create -f - <<EOF
920
apiVersion: metallb.io/v1beta1
1021
kind: MetalLB
@@ -21,7 +32,7 @@ metadata:
2132
namespace: metallb-system
2233
spec:
2334
addresses:
24-
- 192.168.111.30-192.168.111.50
35+
- ${POOL_RANGE}
2536
EOF
2637

2738
oc create -f - <<EOF
@@ -33,4 +44,6 @@ metadata:
3344
spec:
3445
ipAddressPools:
3546
- metallb
47+
interfaces:
48+
- ${METALLB_IFACE}
3649
EOF

0 commit comments

Comments
 (0)