Skip to content

Commit

Permalink
fix: ovn restart issues
Browse files Browse the repository at this point in the history
  • Loading branch information
oilbeater committed Mar 28, 2019
1 parent 433fff2 commit 014f1dc
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 13 deletions.
13 changes: 7 additions & 6 deletions dist/images/start-ovn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@ DB_NB_PORT=${1:-6641}
DB_SB_ADDR=${1:-0.0.0.0}
DB_SB_PORT=${1:-6642}

function quit {
/usr/share/openvswitch/scripts/ovn-ctl stop_ovsdb
/usr/share/openvswitch/scripts/ovn-ctl stop_northd
exit 0
}
trap quit SIGTERM

# Start ovn-northd, ovn-nb and ovn-sb
/usr/share/openvswitch/scripts/ovn-ctl restart_northd

# ovn-nb and ovn-sb listen on tcp ports for ovn-controller to connect
ovn-nbctl set-connection ptcp:${DB_NB_PORT}:${DB_NB_ADDR}
ovn-sbctl set-connection ptcp:${DB_SB_PORT}:${DB_SB_ADDR}

function quit {
/usr/share/openvswitch/scripts/ovn-ctl stop_northd
exit 0
}
trap quit SIGTERM

tail -f /var/log/openvswitch/ovn-northd.log
15 changes: 8 additions & 7 deletions dist/images/start-ovs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ function wait_ovn_sb {
}
wait_ovn_sb

function quit {
/usr/share/openvswitch/scripts/ovs-ctl stop
/usr/share/openvswitch/scripts/ovn-ctl stop_controller
/usr/share/openvswitch/scripts/ovn-ctl stop_controller_vtep
exit 0
}
trap quit SIGTERM

# Start vswitchd
/usr/share/openvswitch/scripts/ovs-ctl restart --no-ovs-vswitchd --system-id=random
# Restrict the number of pthreads ovs-vswitchd creates to reduce the
Expand All @@ -43,12 +51,5 @@ ovs-vsctl set open . external-ids:ovn-remote=tcp:${OVN_SB_SERVICE_HOST}:${OVN_SB
ovs-vsctl set open . external-ids:ovn-encap-type=geneve
ovs-vsctl set open . external-ids:ovn-encap-ip=${POD_IP}

function quit {
/usr/share/openvswitch/scripts/ovs-ctl stop
/usr/share/openvswitch/scripts/ovn-ctl stop_controller
/usr/share/openvswitch/scripts/ovn-ctl stop_controller_vtep
exit 0
}
trap quit SIGTERM

tail -f /var/log/openvswitch/ovs-vswitchd.log
5 changes: 5 additions & 0 deletions dist/yaml/kube-ovn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ spec:
selector:
matchLabels:
app: kube-ovn-controller
strategy:
rollingUpdate:
maxSurge: 0%
maxUnavailable: 100%
type: RollingUpdate
template:
metadata:
labels:
Expand Down
5 changes: 5 additions & 0 deletions dist/yaml/ovn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ metadata:
OVN components: northd, nb and sb.
spec:
replicas: 1
strategy:
rollingUpdate:
maxSurge: 0%
maxUnavailable: 100%
type: RollingUpdate
selector:
matchLabels:
app: ovn-central
Expand Down

0 comments on commit 014f1dc

Please sign in to comment.