From 76106c79c1a4c487a615f443be49a6a97a80df3f Mon Sep 17 00:00:00 2001 From: Alexander Constantinescu Date: Tue, 4 Feb 2020 17:53:29 +0100 Subject: [PATCH] Changing OVN DB readinessProbe to check membership status instead of cluster status --- .../ovn-kubernetes/ovnkube-master.yaml | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/bindata/network/ovn-kubernetes/ovnkube-master.yaml b/bindata/network/ovn-kubernetes/ovnkube-master.yaml index d9196a7758..4891d2b098 100644 --- a/bindata/network/ovn-kubernetes/ovnkube-master.yaml +++ b/bindata/network/ovn-kubernetes/ovnkube-master.yaml @@ -143,6 +143,25 @@ spec: sleep 2 done fi + readinessProbe: + initialDelaySeconds: 30 + exec: + command: + - /bin/bash + - -c + - | + set -xe + # Determine the ovn rundir. + if [[ -f /usr/bin/ovn-appctl ]] ; then + # ovn-appctl is present. Use new ovn run dir path. + DB_SOCK_PATH=/var/run/ovn/ovnnb_db.ctl + APPCTL_PATH=/usr/bin/ovn-appctl + else + # ovn-appctl is not present. Use openvswitch run dir path. + DB_SOCK_PATH=/var/run/openvswitch/ovnnb_db.ctl + APPCTL_PATH=/usr/bin/ovs-appctl + fi + exec ${APPCTL_PATH} -t ${DB_SOCK_PATH} cluster/status OVN_Northbound 2>/dev/null | grep ${K8S_NODE_IP} | grep -v Address -q env: - name: OVN_LOG_LEVEL value: info @@ -236,6 +255,25 @@ spec: sleep 2 done fi + readinessProbe: + initialDelaySeconds: 30 + exec: + command: + - /bin/bash + - -c + - | + set -xe + # Determine the ovn rundir. + if [[ -f /usr/bin/ovn-appctl ]] ; then + # ovn-appctl is present. Use new ovn run dir path. + DB_SOCK_PATH=/var/run/ovn/ovnsb_db.ctl + APPCTL_PATH=/usr/bin/ovn-appctl + else + # ovn-appctl is not present. Use openvswitch run dir path. + DB_SOCK_PATH=/var/run/openvswitch/ovnsb_db.ctl + APPCTL_PATH=/usr/bin/ovs-appctl + fi + exec ${APPCTL_PATH} -t ${DB_SOCK_PATH} cluster/status OVN_Southbound 2>/dev/null | grep ${K8S_NODE_IP} | grep -v Address -q env: - name: OVN_LOG_LEVEL value: info