diff --git a/cluster/ubuntu/util.sh b/cluster/ubuntu/util.sh index 61e5e8dc85b..7e29ab5a317 100755 --- a/cluster/ubuntu/util.sh +++ b/cluster/ubuntu/util.sh @@ -155,6 +155,8 @@ function verify-master(){ printf "Validating master" local -a required_daemon=("kube-apiserver" "kube-controller-manager" "kube-scheduler") local validated="1" + local try_count=1 + local max_try_count=30 until [[ "$validated" == "0" ]]; do validated="0" local daemon @@ -162,6 +164,11 @@ function verify-master(){ ssh $SSH_OPTS "$MASTER" "pgrep -f ${daemon}" >/dev/null 2>&1 || { printf "." validated="1" + ((try_count=try_count+1)) + if [[ ${try_count} -gt ${max_try_count} ]]; then + printf "\nWarning: Process \"${daemon}\" status check timeout, please check manually.\n" + exit 1 + fi sleep 2 } done @@ -175,6 +182,8 @@ function verify-minion(){ printf "Validating ${1}" local -a required_daemon=("kube-proxy" "kubelet" "docker") local validated="1" + local try_count=1 + local max_try_count=30 until [[ "$validated" == "0" ]]; do validated="0" local daemon @@ -182,6 +191,11 @@ function verify-minion(){ ssh $SSH_OPTS "$1" "pgrep -f $daemon" >/dev/null 2>&1 || { printf "." validated="1" + ((try_count=try_count+1)) + if [[ ${try_count} -gt ${max_try_count} ]]; then + printf "\nWarning: Process \"${daemon}\" status check timeout, please check manually.\n" + exit 1 + fi sleep 2 } done