<p>I have 2 nodes that I'm running development pods on. I'd like to be able to echo only the node that a pod is running on based on the name.</p>
<p>I can use <code>kubectl get pod -o=custom-columns=NAME:.metadata.name,NODE:spec.nodeName -n my-namespace</code> to pull back all the names and nodes for all pods in that namespace, but I'd like to filter just the nodename for specific pods. Using grep on the pod name works, but I'm not sure if its possible to only show the node when filtering based off a single pod name.</p>

<p>Option-1: Using <code>custom-columns</code></p>
<pre><code>kubectl get pod mypod -o custom-columns=&quot;:.spec.nodeName&quot; --no-headers 
</code></pre>
<p>Option-2: Using <code>jsonpath</code></p>
<pre><code>kubectl get pod mypod -o jsonpath='{.spec.nodeName}'
</code></pre>
