<p>When we run kubectl get pod  =&gt; it is listing the count of containers running inside a pod and restart count. So I am not sure which container gets restarted. Either I need to login to UI or using kubectl describe pods.</p>
<pre><code>NAME       READY   STATUS    RESTARTS   AGE
test-pod   2/2   Running      5         14h
</code></pre>
<p>But I need to see each container names and its restart count using kubectl command somethings as below.</p>
<pre><code>NAME            STATUS    RESTARTS    AGE
container-1     Running      2         14h
container-2     Running      3         14h
</code></pre>
<p>It would be helpful if someone helps me on this. Thanks in advance!</p>

anonymous user
<p>You can try something like this:</p>
<pre><code>kubectl get pods &lt;pod-name&gt; -o jsonpath='{.spec.containers[*].name} {.status.containerStatuses[*].restartCount} {.status.containerStatuses[*].state}'
</code></pre>
<p>You will get in result container-name, restartCount and state.
Then you will be able to format it in such way as you need.</p>
