Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1886127: [4.5] sdn-ovs: fix liveness probe for downgrade case #837

Merged
merged 1 commit into from
Oct 15, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 17 additions & 12 deletions bindata/network/openshift-sdn/sdn-ovs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,33 +139,38 @@ spec:
livenessProbe:
exec:
command:
# Validate that ovs-vswitchd and ovsdb are running. These three commands check
# 1. that the pids in the pid file are up
# 2. that ovs-vswitchd is responding to queries
# 3. that ovsdb is responding to queries
# 4. if br0 is configured, that its management process is responding
# Validate that ovs-vswitchd and ovsdb are running. Check that
# 1. that ovs-vswitchd is responding to queries
# 2. that ovsdb is responding to queries
#
# Don't bother executing this if we're in systemd, as the liveness
# probe isn't helpful.
- /bin/bash
- -c
- |
#!/bin/bash
if [ -f /host/var/run/ovs-config-executed ]; then
exit 0
fi
/usr/bin/ovs-appctl -T 5 ofproto/list > /dev/null &&
/usr/bin/ovs-vsctl -t 5 show > /dev/null &&
if /usr/bin/ovs-vsctl -t 5 br-exists br0; then /usr/bin/ovs-ofctl -t 5 -O OpenFlow13 probe br0; else true; fi
/usr/bin/ovs-vsctl -t 5 show > /dev/null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't care for the br0 to exist anymore? I thought that was needed for liveness to make sure new pods can come up and flows be configured for them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that doesn't affect openvswitch readiness though. It's not a useful check, really.

initialDelaySeconds: 15
periodSeconds: 5
timeoutSeconds: 21
readinessProbe:
exec:
command:
# The same validation as above, but without checking for br0
# This is because it's created by openshift-sdn, so looking for it
# won't be very meaningful.
# The same validation as above.
#
# Need the manual target file because ovs-appctl doesn't like
# being in a different namespace from ovs-vswitchd, which happens
# if ovs is running in systemd.
- /bin/bash
- -c
- |
#!/bin/bash
/usr/share/openvswitch/scripts/ovs-ctl status > /dev/null &&
/usr/bin/ovs-appctl -T 5 ofproto/list > /dev/null &&
PID=$(cat /var/run/openvswitch/ovs-vswitchd.pid)
/usr/bin/ovs-appctl -t "/var/run/openvswitch/ovs-vswitchd.${PID}.ctl" -T 5 ofproto/list > /dev/null &&
/usr/bin/ovs-vsctl -t 5 show > /dev/null
initialDelaySeconds: 15
periodSeconds: 5
Expand Down