Last active
June 19, 2024 10:50
-
-
Save ernoaapa/c8ef4973aa30104cfc898ec94b7e3f29 to your computer and use it in GitHub Desktop.
Script to list all Kubernetes Pods what are NOT ready
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
#!/bin/sh | |
# | |
# Print Pods which are Pending or not Ready for some reaosn | |
# | |
kubectl get pods --all-namespaces -o go-template='{{ range $item := .items }}{{ range .status.conditions }}{{ if (or (and (eq .type "PodScheduled") (eq .status "False")) (and (eq .type "Ready") (eq .status "False"))) }}{{ $item.metadata.name}} {{ end }}{{ end }}{{ end }}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This one would also catch completed pods (jobs)