Skip to content

Commit

Permalink
CLOUD-2742 - Allow kubernetes to control probe retries; avoid probes …
Browse files Browse the repository at this point in the history
…taking longer than kubernetes timeout settings
  • Loading branch information
luck3y committed May 29, 2019
1 parent 6ed837f commit 6888daf
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
15 changes: 12 additions & 3 deletions os-eap-probes/1.0/added/livenessProbe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ COUNT=30
SLEEP=5
DEBUG_SCRIPT=false
PROBE_IMPL="probe.eap.dmr.EapProbe probe.eap.dmr.HealthCheckProbe"
INITIAL_SLEEP_SECONDS=5

if [ $# -gt 0 ] ; then
COUNT=$1
Expand All @@ -33,9 +34,17 @@ if [ $# -gt 3 ] ; then
PROBE_IMPL=$4
fi

# Sleep for 5 seconds to avoid launching readiness and liveness probes
# at the same time
sleep 5
if [ $# -gt 4 ] ; then
INITIAL_SLEEP_SECONDS=$5
fi

if [ ${INITIAL_SLEEP_SECONDS} -gt 0 ]; then
# Sleep for INITIAL_SLEEP_SECONDS (default legacy value 5) to avoid launching readiness and liveness probes
# at the same time
# this preserves the legacy probe behaviour when using templates that have not been updated.

sleep ${INITIAL_SLEEP_SECONDS}
fi

if [ "$DEBUG_SCRIPT" = "true" ]; then
DEBUG_OPTIONS="--debug --logfile $LOG --loglevel DEBUG"
Expand Down
14 changes: 11 additions & 3 deletions os-eap-probes/2.0/added/livenessProbe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ COUNT=30
SLEEP=5
DEBUG_SCRIPT=false
PROBE_IMPL="probe.eap.dmr.EapProbe probe.eap.dmr.HealthCheckProbe"
INITIAL_SLEEP_SECONDS=5

if [ $# -gt 0 ] ; then
COUNT=$1
Expand All @@ -33,9 +34,16 @@ if [ $# -gt 3 ] ; then
PROBE_IMPL=$4
fi

# Sleep for 5 seconds to avoid launching readiness and liveness probes
# at the same time
sleep 5
if [ $# -gt 4 ] ; then
INITIAL_SLEEP_SECONDS=$5
fi

if [ ${INITIAL_SLEEP_SECONDS} -gt 0 ]; then
# Sleep for INITIAL_SLEEP_SECONDS (default legacy value 5) to avoid launching readiness and liveness probes
# at the same time
# this preserves the legacy probe behaviour when using templates that have not been updated.
sleep ${INITIAL_SLEEP_SECONDS}
fi

if [ "$DEBUG_SCRIPT" = "true" ]; then
DEBUG_OPTIONS="--debug --logfile $LOG --loglevel DEBUG"
Expand Down

0 comments on commit 6888daf

Please sign in to comment.