mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-05 03:03:40 +00:00
local-up-cluster kube-proxy terminated error
When using hack/local-up-cluster.sh deploy local cluster, it failed with following message "kube-proxy terminated unexpectedly" and "Failed to retrieve node info: nodes "127.0.0.1" not found" in kube-proxy.log. The root reason for this error is miss boot order of kubernetes services in local-up-cluster.sh, kube-proxy and kubectl daemon. When starting kube-proxy, it would check node information. And these information are collected by kubelet daemon. However, in the shell script, kube-proxy service start before kubelet daemon. This patch changed the boot order of kubelet daemon and kube-proxy and check if node stats ready for kube-proxy start. Signed-off-by: Howard Zhang <howard.zhang@arm.com>
This commit is contained in:
@@ -64,6 +64,24 @@ kube::util::wait_for_url() {
|
||||
return 1
|
||||
}
|
||||
|
||||
# Example: kube::util::wait_for_success 120 5 "kubectl get nodes|grep localhost"
|
||||
# arguments: wait time, sleep time, shell command
|
||||
# returns 0 if the shell command get output, 1 otherwise.
|
||||
kube::util::wait_for_success(){
|
||||
local wait_time="$1"
|
||||
local sleep_time="$2"
|
||||
local cmd="$3"
|
||||
while [ "$wait_time" -gt 0 ]; do
|
||||
if eval "$cmd"; then
|
||||
return 0
|
||||
else
|
||||
sleep "$sleep_time"
|
||||
wait_time=$((wait_time-sleep_time))
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
# Example: kube::util::trap_add 'echo "in trap DEBUG"' DEBUG
|
||||
# See: http://stackoverflow.com/questions/3338030/multiple-bash-traps-for-the-same-signal
|
||||
kube::util::trap_add() {
|
||||
|
Reference in New Issue
Block a user