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 014f1dc commit e04bc09
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions dist/images/Dockerfile.node
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ RUN mkdir -p /var/run/openvswitch && \
mkdir -p /etc/cni/net.d && \
mkdir -p /opt/cni/bin

COPY ovn-healthcheck.sh /root/ovn-healthcheck.sh
COPY start-ovs.sh /root/start-ovs.sh
COPY start-ovn.sh /root/start-ovn.sh

Expand Down
5 changes: 5 additions & 0 deletions dist/images/ovn-healthcheck.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
set -euo pipefail

ovn-nbctl show
ovn-sbctl show
2 changes: 1 addition & 1 deletion dist/images/start-ovn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function quit {
/usr/share/openvswitch/scripts/ovn-ctl stop_northd
exit 0
}
trap quit SIGTERM
trap quit EXIT

# Start ovn-northd, ovn-nb and ovn-sb
/usr/share/openvswitch/scripts/ovn-ctl restart_northd
Expand Down
3 changes: 1 addition & 2 deletions dist/images/start-ovs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function quit {
/usr/share/openvswitch/scripts/ovn-ctl stop_controller_vtep
exit 0
}
trap quit SIGTERM
trap quit EXIT

# Start vswitchd
/usr/share/openvswitch/scripts/ovs-ctl restart --no-ovs-vswitchd --system-id=random
Expand All @@ -51,5 +51,4 @@ 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}


tail -f /var/log/openvswitch/ovs-vswitchd.log
8 changes: 4 additions & 4 deletions dist/yaml/ovn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,14 @@ spec:
readinessProbe:
exec:
command:
- ovn-nbctl
- show
- sh
- /root/ovn-healthcheck.sh
periodSeconds: 5
livenessProbe:
exec:
command:
- ovn-nbctl
- show
- sh
- /root/ovn-healthcheck.sh
initialDelaySeconds: 10
periodSeconds: 5
failureThreshold: 5
Expand Down

0 comments on commit e04bc09

Please sign in to comment.