@@ -18,6 +18,7 @@ export CLUSTER_TYPE=${CLUSTER_TYPE:-kind}
1818export K3S_KUBECONFIG=${K3S_KUBECONFIG:-/ etc/ rancher/ k3s/ k3s.yaml}
1919
2020# Color codes for terminal output
21+ export RED=' \033[0;31m'
2122export GREEN=' \033[0;32m'
2223export YELLOW=' \033[1;33m'
2324export NC=' \033[0m' # No Color
@@ -226,16 +227,40 @@ wait_for_jumpstarter_resources() {
226227
227228 # Wait for controller deployment to be ready
228229 echo -e " ${GREEN} * Waiting for controller deployment to be ready ...${NC} "
229- kubectl wait --namespace " ${namespace} " \
230+ if ! kubectl wait --namespace " ${namespace} " \
230231 --for=condition=available deployment/jumpstarter-controller \
231- --timeout=180s
232+ --timeout=180s; then
233+ echo -e " ${RED} * Controller deployment failed to become available. Collecting diagnostics ...${NC} "
234+ echo " --- Deployment status ---"
235+ kubectl get deployment jumpstarter-controller -n " ${namespace} " -o wide 2>&1 || true
236+ echo " --- Pod status ---"
237+ kubectl get pods -n " ${namespace} " -l app=jumpstarter-controller -o wide 2>&1 || true
238+ echo " --- Pod describe ---"
239+ kubectl describe pods -n " ${namespace} " -l app=jumpstarter-controller 2>&1 || true
240+ echo " --- Pod logs ---"
241+ kubectl logs -n " ${namespace} " -l app=jumpstarter-controller --tail=100 2>&1 || true
242+ echo " --- Events ---"
243+ kubectl get events -n " ${namespace} " --sort-by=' .lastTimestamp' --field-selector reason! =Pulling 2>&1 | tail -30 || true
244+ echo " --- Operator logs (last 50 lines) ---"
245+ kubectl logs -n jumpstarter-operator-system -l control-plane=controller-manager --tail=50 2>&1 || true
246+ exit 1
247+ fi
232248
233249 # Wait for router statefulset to be ready
234250 echo -e " ${GREEN} * Waiting for router pods to be ready ...${NC} "
235- kubectl wait --namespace " ${namespace} " \
251+ if ! kubectl wait --namespace " ${namespace} " \
236252 --for=condition=ready pod \
237253 --selector=app=jumpstarter-router-0 \
238- --timeout=180s
254+ --timeout=180s; then
255+ echo -e " ${RED} * Router pods failed to become ready. Collecting diagnostics ...${NC} "
256+ echo " --- Pod status ---"
257+ kubectl get pods -n " ${namespace} " -l app=jumpstarter-router-0 -o wide 2>&1 || true
258+ echo " --- Pod describe ---"
259+ kubectl describe pods -n " ${namespace} " -l app=jumpstarter-router-0 2>&1 || true
260+ echo " --- Pod logs ---"
261+ kubectl logs -n " ${namespace} " -l app=jumpstarter-router-0 --tail=100 2>&1 || true
262+ exit 1
263+ fi
239264}
240265
241266# Wait for gRPC endpoint to be ready
0 commit comments