kubectl get
should have a way to filter for advanced pods status #49387
Open
Description
What happened:
I'd like to have a simple command to check for pods that are currently not ready
What you expected to happen:
I can see a couple of options:
- There is some magic flag I am not aware of
- Having a flag for
kubectl get
to filter the output using go/jsonpath - Distinguish between Pod Phase
Running&Ready
andRunning
- Flag to filter on ready status
How to get that currently:
kubectl get pods --all-namespaces -o json | jq -r '.items[] | select(.status.phase != "Running" or ([ .status.conditions[] | select(.type == "Ready" and .state == false) ] | length ) == 1 ) | .metadata.namespace + "/" + .metadata.name'
Metadata
Assignees
Labels
Type
Projects
Status
Needs Triage