<p>Is there a way to find the pod name for a given Docker container ID?</p>

<p>I can do it the other way round "kubectl describe pods" but then I have to run it on all the pods.</p>

<p>Yes, you can get the pod name given a container ID using the following <code>kubectl</code> request:</p>

<pre><code>kubectl get pod -o jsonpath='{range .items[?(@.status.containerStatuses[].containerID=="docker://&lt;container_id&gt;")]}{.metadata.name}{end}' -n &lt;namespace&gt;
</code></pre>

<p>where <code>&lt;container_id&gt;</code> is the long docker container ID and <code>&lt;namespace&gt;</code> is namespace which we can skip if our pod is in default namespace.</p>

<p>For example:</p>

<pre><code>kubectl get pod -o jsonpath='{range .items[?(@.status.containerStatuses[].containerID=="docker://686bc30be6e870023dcf611f7a7808516e041c892a236e565ba2bd3e0569ff7a")]}{.metadata.name}{end}'
nginx-deployment-569477d6d8-xtf42 
</code></pre>
