Add timeout to kubectl get node 56/4356/1
authortrevor tao <trevor.tao@arm.com>
Wed, 23 Jun 2021 14:18:15 +0000 (22:18 +0800)
committertrevor tao <trevor.tao@arm.com>
Wed, 23 Jun 2021 14:18:15 +0000 (22:18 +0800)
Add a timeout to avoid a long time wait
for getting K8s status

Signed-off-by: trevor tao <trevor.tao@arm.com>
Change-Id: If9c60e7f5b0bf7b92e6d8cf9a5e31d5a64ee8c4f

src/foundation/scripts/k8s_master.sh

index 67eecf5..5cce155 100755 (executable)
@@ -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}" \