From: trevor tao Date: Wed, 23 Jun 2021 14:18:15 +0000 (+0800) Subject: Add timeout to kubectl get node X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=commitdiff_plain;h=3da9015a869d219b522c40738981816f545ae449;p=iec.git Add timeout to kubectl get node Add a timeout to avoid a long time wait for getting K8s status Signed-off-by: trevor tao Change-Id: If9c60e7f5b0bf7b92e6d8cf9a5e31d5a64ee8c4f --- diff --git a/src/foundation/scripts/k8s_master.sh b/src/foundation/scripts/k8s_master.sh index 67eecf5..5cce155 100755 --- a/src/foundation/scripts/k8s_master.sh +++ b/src/foundation/scripts/k8s_master.sh @@ -13,7 +13,7 @@ if [ -z "${MGMT_IP}" ]; then exit 1 fi -if ! kubectl get nodes; then +if ! kubectl get nodes --request-timeout=3s; then sudo kubeadm config images pull sudo kubeadm init \ --pod-network-cidr="${POD_NETWORK_CIDR}" \