IssueRaiser

`kubectl get` should have a way to filter for advanced pods status

**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` and `Running` * 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' ```

Posted by simonswine on Jul 21, 2017, 2:57 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.4,500 issues0 comments

github (Other)

`kubectl get` should have a way to filter for advanced pods status

simonswineJul 21, 2017, 2:57 PM

**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` and `Running` * 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' ```

Comments (0)

No comments yet. Start the discussion.

Comment on this issue