diff --git a/cicd/k8s-calico/config.sh b/cicd/k8s-calico/config.sh index 65beb8f7..1a81f9f3 100755 --- a/cicd/k8s-calico/config.sh +++ b/cicd/k8s-calico/config.sh @@ -45,3 +45,28 @@ vagrant ssh master -c 'kubectl apply -f /vagrant/yaml/sctp_onearm.yml' 2> /dev/n vagrant ssh master -c 'kubectl apply -f /vagrant/yaml/tcp_fullnat.yml' 2> /dev/null vagrant ssh master -c 'kubectl apply -f /vagrant/yaml/udp_fullnat.yml' 2> /dev/null vagrant ssh master -c 'kubectl apply -f /vagrant/yaml/sctp_fullnat.yml' 2> /dev/null + +for((i=1; i<=60; i++)) +do + fin=1 + pods=$(vagrant ssh master -c 'kubectl get pods -A' 2> /dev/null | grep -v "NAMESPACE") + + while IFS= read -a pods; do + read -a pod <<< "$pods" + if [[ ${pod[3]} != *"Running"* ]]; then + echo "${pod[1]} is not UP yet" + fin=0 + fi + done <<< "$pods" + if [ $fin == 1 ]; + then + echo "Cluster is ready" + break; + fi + echo "Will try after 10s" + sleep 10 +done + +if [[ $fin == 0 ]]; then + exit 1 +fi diff --git a/cicd/k8s-calico/node_scripts/common.sh b/cicd/k8s-calico/node_scripts/common.sh index cf1e66f1..1e68fa83 100644 --- a/cicd/k8s-calico/node_scripts/common.sh +++ b/cicd/k8s-calico/node_scripts/common.sh @@ -26,7 +26,7 @@ sudo apt-get update -y # Install CRI-O Runtime VERSION="$(echo ${KUBERNETES_VERSION} | grep -oE '[0-9]+\.[0-9]+')" - +CRIO_VERSION=1.27 # Create the .conf file to load the modules at bootup cat <