From ed3832e5173a49130b745dfcff174276550da42e Mon Sep 17 00:00:00 2001 From: Nishan Date: Tue, 2 Dec 2025 08:38:16 +0530 Subject: [PATCH] Fix: deployment issue --- jumphost/scripts/prepare-exam-env.sh | 1 + kind-cluster/scripts/env-setup | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/jumphost/scripts/prepare-exam-env.sh b/jumphost/scripts/prepare-exam-env.sh index 33d01c9..7c34866 100644 --- a/jumphost/scripts/prepare-exam-env.sh +++ b/jumphost/scripts/prepare-exam-env.sh @@ -63,6 +63,7 @@ sleep 5 #wait till api-server is ready while ! kubectl get nodes > /dev/null 2>&1; do + log "API server is not ready, retrying..." sleep 5 done diff --git a/kind-cluster/scripts/env-setup b/kind-cluster/scripts/env-setup index deb7850..6bac82b 100755 --- a/kind-cluster/scripts/env-setup +++ b/kind-cluster/scripts/env-setup @@ -54,13 +54,9 @@ metadata: name: $CLUSTER_NAME servers: 1 agents: $NUM_WORKERS -ports: - - port: "$API_PORT:6443" - nodeFilters: - - loadbalancer kubeAPI: host: "127.0.0.1" - hostPort: "$API_PORT" + hostPort: "6443" options: k3s: extraArgs: @@ -107,10 +103,15 @@ echo "$(date '+%Y-%m-%d %H:%M:%S') | ✅ K3d cluster '$CLUSTER_NAME' is up and r echo "$(date '+%Y-%m-%d %H:%M:%S') | Docker and KIND environment is ready for use" +k3d kubeconfig get $CLUSTER_NAME > /home/candidate/.kube/kubeconfig +echo "Kubeconfig file created: /home/candidate/.kube/kubeconfig" + # Save kubeconfig and set API server address -cp /home/candidate/.kube/config /home/candidate/.kube/kubeconfig sed -i 's|server: https://127\.0\.0\.1:\([0-9]*\)|server: https://k8s-api-server:\1|' /home/candidate/.kube/kubeconfig +echo "Kubeconfig file content:" +cat /home/candidate/.kube/kubeconfig + export KUBECONFIG=/home/candidate/.kube/kubeconfig #info on config file setup done