<p>How to list All Containers that are not running using <strong>Kubectl</strong> command.  I want output like</p>
<pre><code>CONTAINER_NAME   STATUS        POD_NAME       NAMESPACE &lt;br&gt;
container_1      Running       pod_1          ns1       &lt;br&gt;
container_2      Not Running   pod_2          ns2       &lt;br&gt;
container_3      Running       pod_2          ns2       &lt;br&gt;
</code></pre>

prosenjit
<pre><code>kubectl get pods --field-selector status.phase!=Running
</code></pre>
<p>Above command will above list down all pods, not in Running status for default namespace.</p>
<p>if you want to run a command across all namespaces &amp; list down all PODS</p>
<pre><code>kubectl get pods --field-selector status.phase!=Running --all-namespaces
</code></pre>
<p>You can also print custom column as per require if you want to print <strong>Namespace</strong></p>
<pre><code>kubectl get pod --field-selector status.phase!=Running -o=custom-columns=NAME:.metadata.name,STATUS:.status.phase,NAMEDPACE:.metadata.namespace
</code></pre>
<p>Final command the way you are looking forward with columns</p>
<pre><code>kubectl get pod --field-selector status.phase!=Running -o=custom-columns=POD_NAME:.metadata.name,STATUS:.status.phase,NAMEDPACE:.metadata.namespace,CONTAINER_NAME:.spec.containers[*].name
</code></pre>
