Last active
July 14, 2023 18:38
-
-
Save stewartshea/24af6a3c709a53a4e34be8ba5f8d18a7 to your computer and use it in GitHub Desktop.
Troubleshoot Pending Pods in Namespace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kubectl get pods --context=${CONTEXT} -n ${NAMESPACE} --field-selector=status.phase=Pending --no-headers -o json | jq -r '.items[] | "---\npod_name: \(.metadata.name)\nstatus: \(.status.phase // "N/A")\nmessage: \(.status.conditions[].message // "N/A")\nreason: \(.status.conditions[].reason // "N/A")\ncontainerStatus: \((.status.containerStatuses // [{}])[].state // "N/A")\ncontainerMessage: \((.status.containerStatuses // [{}])[].state?.waiting?.message // "N/A")\ncontainerReason: \((.status.containerStatuses // [{}])[].state?.waiting?.reason // "N/A")\n---\n"' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment