<p>I am creating a CI/CD pipeline.</p>

<p>I run <code>helm install --wait --timeout 300 ...</code>. But that doesn't really wait, just returns when the "release" status is <code>DEPLOYED</code>.</p>

<p>So then I see a few things in  <code>kubectl get pods --namespace default -l 'release=${TAG}' -o yaml</code> that could be used:</p>

<pre><code>- kind: Pod
  status:
    conditions:
    - lastProbeTime: null
      lastTransitionTime: 2018-05-11T00:30:46Z
      status: "True"
      type: Initialized
    - lastProbeTime: null
      lastTransitionTime: 2018-05-11T00:30:48Z
      status: "True"
      type: Ready
</code></pre>

<p>So I guess I will look at when <code>Ready</code> condition becomes "True".</p>

<ol>
<li><p>It feels a bit wrong thing to do... Everyone solves this so I assume there is some feature of <code>kubectl</code> for that, is there?</p></li>
<li><p>Is this the right thing to query? (See <a href="https://kubernetes.io/docs/reference/kubectl/jsonpath/" rel="noreferrer">Kubernetes JSONPath reference</a>)</p>

<p>kubectl get pods --namespace default -l 'release=sc8757070' -o jsonpath='{.items[*].status.conditions[?(@.type=="Ready")].status}'</p></li>
</ol>

<p>Kubernetes already has something to wait on pods (and print a message every time something changes and print a summary at the end).</p>
<pre><code># kubectl rollout status RESOURCE_TYPE RESOURCE_NAME 
kubectl rollout status statefulset app1-hello

# with timeout set to 300 seconds
kubectl rollout status statefulset app1-hello --timeout=300s
</code></pre>
