Skip to content
This repository was archived by the owner on Mar 23, 2020. It is now read-only.

Commit 906b585

Browse files
committed
configure linux bridge as the default network interface
Signed-off-by: Petr Horacek <[email protected]>
1 parent 61ea368 commit 906b585

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

CNV/cnv-2.1.0.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,3 +154,47 @@ metadata:
154154
namespace: "${TARGET_NAMESPACE}"
155155
spec: {}
156156
EOF
157+
158+
echo "Waiting for HCO to get fully deployed"
159+
oc wait -n ${TARGET_NAMESPACE} hyperconverged hyperconverged-cluster --for condition=Available --timeout=10m
160+
161+
echo "Setting up a bridge as the default interface"
162+
163+
while ! default_iface=$(oc get nodenetworkstate -o jsonpath='{.items[0].status.currentState.routes.running[?(@.destination=="0.0.0.0/0")].next-hop-interface}'); do
164+
sleep 10
165+
done
166+
167+
cat <<EOF | oc apply -f -
168+
apiVersion: nmstate.io/v1alpha1
169+
kind: NodeNetworkConfigurationPolicy
170+
metadata:
171+
name: brext-policy
172+
spec:
173+
desiredState:
174+
interfaces:
175+
- name: brext
176+
type: linux-bridge
177+
state: up
178+
ipv4:
179+
dhcp: true
180+
enabled: true
181+
ipv6:
182+
dhcp: true
183+
enabled: true
184+
bridge:
185+
options:
186+
vlan-filtering: true
187+
vlans:
188+
- vlan-range-min: 2
189+
vlan-range-max: 4094
190+
port:
191+
- name: ${default_interface}
192+
vlans:
193+
- vlan-range-min: 2
194+
vlan-range-max: 4094
195+
EOF
196+
197+
echo "Waiting until all nodes come back"
198+
sleep 10
199+
until oc get nodes 2> /dev/null; do sleep 10; done
200+
oc wait --all nodes --for condition=Ready --timeout=5m

0 commit comments

Comments
 (0)