You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ci-operator/step-registry/hypershift/kubevirt/baremetalds/metallb/hypershift-kubevirt-baremetalds-metallb-commands.sh
+20-1Lines changed: 20 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,23 @@ set -o errexit
5
5
set -o pipefail
6
6
set -x
7
7
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) lives on
15
+
# br-ex (OVS external bridge). With OpenShiftSDN the raw NIC keeps the
16
+
# IP directly. Detect the network type and choose accordingly.
17
+
NETWORK_TYPE=$(oc get network.config cluster -o jsonpath='{.status.networkType}')
18
+
if [[ "${NETWORK_TYPE}"=="OVNKubernetes" ]];then
19
+
METALLB_IFACE="br-ex"
20
+
else
21
+
METALLB_IFACE="enp2s0"
22
+
fi
23
+
echo"Detected network type ${NETWORK_TYPE}, using interface ${METALLB_IFACE} for L2 advertisements"
0 commit comments