How to wait for a Kubernetes pod to be ready — one liner

By pod name:

while [[ $(kubectl get pods hello-d8d8d7455-j9nzw -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') != "True" ]]; do echo "waiting for pod" && sleep 1; done

By label (deployment):

while [[ $(kubectl get pods -l app=hello -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') != "True" ]]; do echo "waiting for pod" && sleep 1; done

If your pod is in another namespace (not default), use:

kubectl -n <your-namespace>...

Tufin CTO & Co-Founder