Konubinix' opinionated web of thoughts

Kubectl JsonPath Nested Condition and Multiple Conditions Are Not Working

Fleeting

kubectl, jsonpath

kubectl get pods -l app=my-app -o jsonpath=’{.items[?(@.status.conditions[?(@.type = "Ready")].status = “True”)].status.phase}'

OR

kubectl get pods -l app=my-app -o jsonpath=’{.items[?(@.status.conditions[*].type = "Ready" && @.status.conditions[*].status = “True”)].status.phase}'

Neither of them works. Jsonpath doesn’t support nested filters or multiple filters.

https://github.com/kubernetes/kubernetes/issues/20352