mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-28 21:13:35 +00:00
add time out exit when process not started correctly on master or minion
This commit is contained in:
parent
ab73849437
commit
0705ef9495
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user