From b93e07740dc2ba80981ba7f667b78f2ba8a6146b Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Tue, 6 Dec 2022 16:02:47 -0600 Subject: [PATCH] use python http server to see discovery.yaml --- terraform/scripts/initialize-controlplane.sh | 5 ++++- terraform/scripts/join-workers.sh | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/terraform/scripts/initialize-controlplane.sh b/terraform/scripts/initialize-controlplane.sh index 8a30755..51823bf 100644 --- a/terraform/scripts/initialize-controlplane.sh +++ b/terraform/scripts/initialize-controlplane.sh @@ -64,6 +64,8 @@ EOF fi fi echo ">> Waiting up to 15 minutes for all nodes to be Ready..." + python3 -m http.server & + PROC_ID=$! attempts_max=90 attempt=0 until [ "$(kubectl get nodes | grep -c ' Ready ')" == "${K8S_NODE_COUNT}" ]; do @@ -74,6 +76,7 @@ EOF attempt=$((attempt+1)) sleep 10 done + kill $PROC_ID echo ">> Continuing after $((attempt*10)) seconds." echo ">> Configuring vSphere Cloud Provider Interface..." cat << EOF | kubectl apply -f - @@ -371,7 +374,7 @@ else attempts_max=6 attempt=0 until [ -f /etc/kubernetes/discovery.yaml ]; do - scp -o StrictHostKeyChecking=no "${K8S_CONTROLPLANE_VIP}":discovery.yaml . 2>/dev/null + wget "http://${K8S_CONTROLPLANE_VIP}:8000/discovery.yaml" 2>/dev/null sudo install -o root -g root -m 600 discovery.yaml /etc/kubernetes/discovery.yaml 2>/dev/null if [ ! -f /etc/kubernetes/discovery.yaml ]; then attempt=$((attempt+1)) diff --git a/terraform/scripts/join-workers.sh b/terraform/scripts/join-workers.sh index 914b5e1..00c15ac 100644 --- a/terraform/scripts/join-workers.sh +++ b/terraform/scripts/join-workers.sh @@ -30,7 +30,7 @@ echo ">> Joining cluster..." attempts_max=6 attempt=0 until [ -f /etc/kubernetes/discovery.yaml ]; do - scp -o StrictHostKeyChecking=no "${K8S_CONTROLPLANE_VIP}":discovery.yaml . 2>/dev/null + wget "http://${K8S_CONTROLPLANE_VIP}:8000/discovery.yaml" 2>/dev/null sudo install -o root -g root -m 600 discovery.yaml /etc/kubernetes/discovery.yaml 2>/dev/null if [ ! -f /etc/kubernetes/discovery.yaml ]; then attempt=$((attempt+1))