From 2e5b51990f5f8fae22cc2a728d56a0cba4e887e6 Mon Sep 17 00:00:00 2001 From: Nikhil Malik Date: Fri, 5 Jan 2024 11:05:58 +0900 Subject: [PATCH] K8s-calico-ipvs3-ha failing in github CICD - fixed --- cicd/k8s-calico-ipvs3-ha/config.sh | 24 +++++++++++++++++++ cicd/k8s-calico-ipvs3-ha/node_scripts/host.sh | 1 + 2 files changed, 25 insertions(+) diff --git a/cicd/k8s-calico-ipvs3-ha/config.sh b/cicd/k8s-calico-ipvs3-ha/config.sh index f58e470e..77e06006 100755 --- a/cicd/k8s-calico-ipvs3-ha/config.sh +++ b/cicd/k8s-calico-ipvs3-ha/config.sh @@ -37,3 +37,27 @@ vagrant ssh master -c 'kubectl apply -f /vagrant/yaml/tcp_fullnat.yml' 2> /dev/n vagrant ssh master -c 'kubectl apply -f /vagrant/yaml/tcp_default.yml' 2> /dev/null vagrant ssh master -c 'kubectl apply -f /vagrant/yaml/sctp_fullnat.yml' 2> /dev/null vagrant ssh master -c 'kubectl apply -f /vagrant/yaml/sctp_default.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 + break; + fi + echo "Will try after 10s" + sleep 10 +done +if [[ $fin == 0 ]]; then + echo "Cluster is not ready" + exit 1 +fi +echo "Cluster is ready" diff --git a/cicd/k8s-calico-ipvs3-ha/node_scripts/host.sh b/cicd/k8s-calico-ipvs3-ha/node_scripts/host.sh index d7821be5..3b820256 100755 --- a/cicd/k8s-calico-ipvs3-ha/node_scripts/host.sh +++ b/cicd/k8s-calico-ipvs3-ha/node_scripts/host.sh @@ -1,4 +1,5 @@ # Install Bird to work with k3s +sudo apt-get update sudo apt-get -y install bird2 lksctp-tools iperf sudo ip addr add 30.30.30.1/32 dev lo