<p>I was trying to get the Ready status of pods by using -o=jsonpath.
To be more clear of what I want, I would like to get the value 1/1 of the following example using  -o=jsonpath.</p>

<pre><code>NAME       READY     STATUS    RESTARTS   AGE
some_pod   1/1       Running   1          34d
</code></pre>

<p>I have managed to get some information such as the pod name or namespace.</p>

<pre><code>kubectl get pods --all-namespaces -o=jsonpath='{range .items[*]}{"\n"}{.metadata.namespace}{"\t"}{.metadata.name}{"\t"}{end}'
</code></pre>

<p>And I get somthing like:</p>

<blockquote>
  <p>some_namespace1    pod_name1</p>
</blockquote>

<p>However, I don't know how to get the Ready status. What I would like to have is an aoutput similar to this:</p>

<blockquote>
  <p>some_namespace1    pod_name1   1/1</p>
</blockquote>

<p>I know I can use bash commands like cut:</p>

<pre><code>kubectl get pods --all-namespaces| tail -1 | cut -d' ' -f8
</code></pre>

<p>However, I would like to get it by using kubectl </p>

pcampana
<p>You can get all the pods status using the following command:</p>

<pre><code>kubectl get pods -o jsonpath={.items[*].status.phase}
</code></pre>

<p>Similar commands you can use for the name</p>

<pre><code>kubectl get pods -o jsonpath={.items[*].metadata.name}
</code></pre>

<p>EDIT:</p>

<p>You need to compare the <code>.status.replicas</code> and <code>.status.readyReplicas</code> to get how many ready replicas are there. </p>
