diff --git a/spartan/scripts/deploy_kind.sh b/spartan/scripts/deploy_kind.sh index 4e5ce07bbb1b..28ed7c75f9f5 100755 --- a/spartan/scripts/deploy_kind.sh +++ b/spartan/scripts/deploy_kind.sh @@ -46,11 +46,42 @@ function show_status_until_pxe_ready { set +x # don't spam with our commands sleep 15 # let helm upgrade start for i in {1..100}; do + echo "--- Pod status ---" + kubectl get pods -n "$namespace" + + # Look for problematic pods and show their details + echo "--- Problem Pod Details ---" + for pod in $(kubectl get pods -n "$namespace" -o jsonpath='{.items[?(@.status.phase!="Running" && @.status.phase!="Succeeded")].metadata.name}'); do + echo "Details for problematic pod $pod:" + kubectl describe pod -n "$namespace" $pod | grep -E 'Events:|Error:|Warning:|^ Warning|^ Normal|Message:|Reason:' + echo "-------------------" + done + + # Show pod events + echo "--- Recent Pod Events ---" + kubectl get events -n "$namespace" --sort-by='.lastTimestamp' | tail -10 + + # Show service status + echo "--- Service Status ---" + kubectl get services -n "$namespace" + + # Show logs from validator pods only + echo "--- Validator Pod logs ---" + for pod in $(kubectl get pods -n "$namespace" -l app=validator -o jsonpath='{.items[?(@.status.phase=="Running")].metadata.name}'); do + echo "Logs from $pod:" + kubectl logs --tail=10 -n "$namespace" $pod 2>/dev/null || echo "Cannot get logs yet" + echo "-------------------" + done + + # Check PXE pod status specifically + echo "--- PXE Pod Status ---" + kubectl get pods -n "$namespace" -l app=pxe -o wide + if kubectl wait pod -l app==pxe --for=condition=Ready -n "$namespace" --timeout=20s >/dev/null 2>/dev/null; then break # we are up, stop showing status fi - # show startup status - kubectl get pods -n "$namespace" + + sleep 20 done }