Add debug info when wait-for-pods.sh fails
Sometimes jobs fail due to pending pods and we need a way to debug this. This PR adds `kubectl describe po` for pods if not all pods are ready. Change-Id: Iefc03bfbd26764feb54789981bdf0072e0536ee5
This commit is contained in:
parent
056655d1cd
commit
1f222fc438
@ -42,8 +42,13 @@ while true; do
|
|||||||
echo "Some pods are in pending state:"
|
echo "Some pods are in pending state:"
|
||||||
kubectl get pods --field-selector=status.phase=Pending -n $1 -o wide
|
kubectl get pods --field-selector=status.phase=Pending -n $1 -o wide
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ $READY == "False" ] && echo "Some pods are not ready"
|
[ $READY == "False" ] && echo "Some pods are not ready"
|
||||||
[ $JOBR == "False" ] && echo "Some jobs have not succeeded"
|
[ $JOBR == "False" ] && echo "Some jobs have not succeeded"
|
||||||
|
echo
|
||||||
|
echo "=== DEBUG ==="
|
||||||
|
echo
|
||||||
|
kubectl get pods -n $1 | tail -n +2 | awk '{print $1}' | while read pname; do kubectl describe po $pname -n $1; echo; done
|
||||||
exit -1
|
exit -1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user