<p>I am trying to find a command or a sample shell snippet where I can wait until the list of Kubernetes pods is successful. I have checked the <a href="https://stackoverflow.com/questions/44686568/kubernetes-tell-when-job-is-complete">answer</a> but it was not giving any output. Can someone guide me or suggest an approach, I am completely new to kubernetes.</p>

<pre><code>kubectl -n test-ns get jobs -w

NAME     DESIRED   SUCCESSFUL   AGE
test-1    1         1            2d
test-2    1         1            2d
test-3    1         1            2d
test-4    1         1            2d


until kubectl get jobs -n test-ns  -o jsonpath='{.status.conditions[?(@.type=="Complete")].status}' | grep True ; do sleep 1 ; done
</code></pre>

<p>This is not giving any output </p>

<p>To wait until your pods are running, check for "condition=ready" and filter by app label, for example:</p>

<pre><code>$ kubectl wait --for=condition=ready pod -l app=netshoot 
pod/netshoot-58785d5fc7-xt6fg condition met
</code></pre>
