Skip to content

Commit

Permalink
fix: livenessProb/readinessProb might conflict when run logrotate at …
Browse files Browse the repository at this point in the history
…same time
  • Loading branch information
oilbeater committed Dec 18, 2020
1 parent 9e5d98d commit f922ef7
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 deletions.
25 changes: 13 additions & 12 deletions dist/images/install-pre-1.16.sh
Original file line number Diff line number Diff line change
Expand Up @@ -700,14 +700,14 @@ spec:
readinessProbe:
exec:
command:
- sh
- bash
- /kube-ovn/ovn-is-leader.sh
periodSeconds: 3
timeoutSeconds: 45
livenessProbe:
exec:
command:
- sh
- bash
- /kube-ovn/ovn-healthcheck.sh
initialDelaySeconds: 30
periodSeconds: 7
Expand Down Expand Up @@ -882,14 +882,14 @@ spec:
readinessProbe:
exec:
command:
- sh
- bash
- /kube-ovn/ovs-dpdk-healthcheck.sh
periodSeconds: 5
timeoutSeconds: 45
livenessProbe:
exec:
command:
- sh
- bash
- /kube-ovn/ovs-dpdk-healthcheck.sh
initialDelaySeconds: 10
periodSeconds: 5
Expand Down Expand Up @@ -1204,14 +1204,15 @@ spec:
readinessProbe:
exec:
command:
- sh
- /kube-ovn/ovn-is-leader.sh
- bash
- -c
- LOG_ROTATE=true /kube-ovn/ovn-is-leader.sh
periodSeconds: 3
timeoutSeconds: 45
livenessProbe:
exec:
command:
- sh
- bash
- /kube-ovn/ovn-healthcheck.sh
initialDelaySeconds: 30
periodSeconds: 7
Expand Down Expand Up @@ -1383,14 +1384,14 @@ spec:
readinessProbe:
exec:
command:
- sh
- bash
- /kube-ovn/ovs-healthcheck.sh
periodSeconds: 5
timeoutSeconds: 45
livenessProbe:
exec:
command:
- sh
- bash
- /kube-ovn/ovs-healthcheck.sh
initialDelaySeconds: 10
periodSeconds: 5
Expand Down Expand Up @@ -1520,14 +1521,14 @@ spec:
readinessProbe:
exec:
command:
- sh
- bash
- /kube-ovn/kube-ovn-controller-healthcheck.sh
periodSeconds: 3
timeoutSeconds: 45
livenessProbe:
exec:
command:
- sh
- bash
- /kube-ovn/kube-ovn-controller-healthcheck.sh
initialDelaySeconds: 300
periodSeconds: 7
Expand Down Expand Up @@ -1590,7 +1591,7 @@ spec:
image: "$REGISTRY/kube-ovn:$VERSION"
imagePullPolicy: $IMAGE_PULL_POLICY
command:
- sh
- bash
- /kube-ovn/start-cniserver.sh
args:
- --enable-mirror=$ENABLE_MIRROR
Expand Down
4 changes: 2 additions & 2 deletions dist/images/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,8 @@ spec:
exec:
command:
- bash
- /kube-ovn/ovs-healthcheck.sh
- -c
- LOG_ROTATE=true /kube-ovn/ovs-healthcheck.sh
periodSeconds: 5
timeoutSeconds: 45
livenessProbe:
Expand Down Expand Up @@ -2169,7 +2170,6 @@ echo "-------------------------------"
echo ""

echo "[Step 6] Run network diagnose"
sleep 60
kubectl ko diagnose all

echo "-------------------------------"
Expand Down
8 changes: 6 additions & 2 deletions dist/images/ovs-healthcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ set -euo pipefail
shopt -s expand_aliases

OVN_DB_IPS=${OVN_DB_IPS:-}
ENABLE_SSL=${ENABLE_SSL:-false}
LOG_ROTATE=${LOG_ROTATE:-false}

logrotate /etc/logrotate.d/openvswitch
logrotate /etc/logrotate.d/ovn
if [[ "$LOG_ROTATE" == "true" ]]; then
logrotate /etc/logrotate.d/openvswitch
logrotate /etc/logrotate.d/ovn
fi

function gen_conn_str {
if [[ -z "${OVN_DB_IPS}" ]]; then
Expand Down

0 comments on commit f922ef7

Please sign in to comment.