Skip to content

Commit

Permalink
Fixes OVN upgrade with shared gateway mode
Browse files Browse the repository at this point in the history
With OCP upgrade today, CNO happens before MCO. When upgrading from 4.5
to 4.6, 4.6 OVN expects system OVS to be there and configured which will
not happen until MCO upgrade finishes. Therefore upon initial CNO
upgrade, we will run in local gateway mode until the node is rebooted
via MCO with a machine-os-content change to include system OVS and run
the ovs-configuration service.

Signed-off-by: Tim Rozet <trozet@redhat.com>
  • Loading branch information
trozet committed Aug 14, 2020
1 parent 16722d8 commit 22a0258
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
12 changes: 10 additions & 2 deletions bindata/network/ovn-kubernetes/ovnkube-master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,15 @@ spec:
fi
fi
gateway_mode_flags=
# Check to see if ovs is provided by the node. This is only for upgrade from 4.5->4.6
# REMOVEME in 4.7
if systemctl status ovsdb-server; then
gateway_mode_flags="--gateway-mode shared --gateway-interface br-ex"
else
gateway_mode_flags="--gateway-mode local"
fi
# start nbctl daemon for caching
echo "I$(date "+%m%d %H:%M:%S.%N") - ovnkube-master - start nbctl daemon for caching"
export OVN_NB_DAEMON=$(ovn-nbctl --pidfile=/var/run/ovn/ovn-nbctl.pid \
Expand All @@ -513,8 +522,7 @@ spec:
--loglevel "${OVN_KUBE_LOG_LEVEL}" \
${hybrid_overlay_flags} \
--metrics-bind-address "127.0.0.1:29102" \
--gateway-mode shared \
--gateway-interface br-ex \
${gateway_mode_flags} \
--sb-address "{{.OVN_SB_DB_LIST}}" \
--sb-client-privkey /ovn-cert/tls.key \
--sb-client-cert /ovn-cert/tls.crt \
Expand Down
14 changes: 11 additions & 3 deletions bindata/network/ovn-kubernetes/ovnkube-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,16 @@ spec:
hybrid_overlay_flags="${hybrid_overlay_flags} --hybrid-overlay-vxlan-port={{.OVNHybridOverlayVXLANPort}}"
fi
fi
gateway_mode_flags=
# Check to see if ovs is provided by the node. This is only for upgrade from 4.5->4.6
# REMOVEME in 4.7
if systemctl status ovsdb-server; then
gateway_mode_flags="--gateway-mode shared --gateway-interface br-ex"
else
gateway_mode_flags="--gateway-mode local"
fi
exec /usr/bin/ovnkube --init-node "${K8S_NODE}" \
--nb-address "{{.OVN_NB_DB_LIST}}" \
--sb-address "{{.OVN_SB_DB_LIST}}" \
Expand All @@ -145,8 +154,7 @@ spec:
--loglevel "${OVN_KUBE_LOG_LEVEL}" \
--inactivity-probe="${OVN_CONTROLLER_INACTIVITY_PROBE}" \
${hybrid_overlay_flags} \
--gateway-mode shared \
--gateway-interface br-ex \
${gateway_mode_flags} \
--metrics-bind-address "127.0.0.1:29103"
env:
# for kubectl
Expand Down

0 comments on commit 22a0258

Please sign in to comment.