<p>I have a command <code>kubectl run -it my-pod --image=&lt;my-image&gt; /bin/sh</code> and I'd like the pod to be scheduled on a specific node.</p>
<p>Is that possible and, if so, how?</p>

<p>Get the hostname:</p>
<pre><code>kubectl get nodes
</code></pre>
<p>Schedule pod on a specific node:</p>
<pre><code>kubectl run mypod --image ubuntu:18.04 --overrides='{&quot;apiVersion&quot;: &quot;v1&quot;, &quot;spec&quot;: {&quot;nodeSelector&quot;: { &quot;kubernetes.io/hostname&quot;: &quot;my-node.internal&quot; }}}' --command -- sleep 100000000000000
</code></pre>
<p>or</p>
<pre><code>kubectl run mypod --image ubuntu:18.04 --overrides='{&quot;apiVersion&quot;: &quot;apps/v1&quot;, &quot;spec&quot;: {&quot;nodeSelector&quot;: { &quot;kubernetes.io/hostname&quot;: &quot;my-node.internal&quot; }}}' --command -- sleep 100000000000000
</code></pre>
<p>You may need to change <code>apiVersion</code> value, please find one:</p>
<pre><code>kubectl api-versions
</code></pre>
