Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions assets/components/ovn/multi-node/node/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,14 @@ spec:
- -c
- |
set -xe
# Remove any CNI conf left over from a previous container instance that
# exited without running preStop (crash/OOM/reboot). ovnkube writes the
# file only if it is absent, so a stale copy would satisfy the startup
# and readiness probes before this instance finishes init. This runs on
# every container start (unlike preStop or an initContainer, which do
# not), and the startupProbe initialDelaySeconds keeps the probe from
# racing this removal.
rm -f /etc/cni/net.d/10-ovn-kubernetes.conf
if [[ -f "/env/_master" ]]; then
set -o allexport
source "/env/_master"
Expand Down Expand Up @@ -160,6 +168,18 @@ spec:
preStop:
exec:
command: ["rm","-f","/etc/cni/net.d/10-ovn-kubernetes.conf"]
# The CNI conf file is written only once node init completes, so its
# presence is a reliable "started" signal. Bound a wedged init to ~180s
# while tolerating slow starts.
startupProbe:
exec:
command: ["test", "-f", "/etc/cni/net.d/10-ovn-kubernetes.conf"]
# Give the container's startup rm time to clear a stale conf before the
# first probe, so a leftover file cannot prematurely satisfy it.
initialDelaySeconds: 5
periodSeconds: 5
timeoutSeconds: 5
failureThreshold: 36
readinessProbe:
exec:
command: ["test", "-f", "/etc/cni/net.d/10-ovn-kubernetes.conf"]
Expand Down
20 changes: 20 additions & 0 deletions assets/components/ovn/single-node/master/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,14 @@ spec:
- -c
- |
set -xe
# Remove any CNI conf left over from a previous container instance that
# exited without running preStop (crash/OOM/reboot). ovnkube writes the
# file only if it is absent, so a stale copy would satisfy the startup
# and readiness probes before this instance finishes init. This runs on
# every container start (unlike preStop or an initContainer, which do
# not), and the startupProbe initialDelaySeconds keeps the probe from
# racing this removal.
rm -f /etc/cni/net.d/10-ovn-kubernetes.conf
if [[ -f "/env/_master" ]]; then
set -o allexport
source "/env/_master"
Expand Down Expand Up @@ -397,6 +405,18 @@ spec:
preStop:
exec:
command: ["rm","-f","/etc/cni/net.d/10-ovn-kubernetes.conf"]
# The CNI conf file is written only once node init completes, so its
# presence is a reliable "started" signal. Bound a wedged init to ~180s
# while tolerating slow starts.
startupProbe:
exec:
command: ["test", "-f", "/etc/cni/net.d/10-ovn-kubernetes.conf"]
# Give the container's startup rm time to clear a stale conf before the
# first probe, so a leftover file cannot prematurely satisfy it.
initialDelaySeconds: 5
periodSeconds: 5
timeoutSeconds: 5
failureThreshold: 36
readinessProbe:
exec:
command: ["test", "-f", "/etc/cni/net.d/10-ovn-kubernetes.conf"]
Expand Down