<p>Is there a way to specify the nodeSelector when using the Kubernetes run command? </p>

<p>I don't have a yaml file and I only want to override the nodeSelector.</p>

<p>I tried the following but didn't work:</p>

<pre><code>kubectl run myservice --image myserviceimage:latest --overrides='{ "nodeSelector": { "beta.kubernetes.io/os": "windows" } }'
</code></pre>

<p><code>nodeSelector</code> must be wrapped with a <code>spec</code>. Like so</p>
<pre><code>kubectl run -ti --rm test --image=ubuntu:18.04 --overrides='{&quot;spec&quot;: { &quot;nodeSelector&quot;: {&quot;kubernetes.io/hostname&quot;: &quot;eks-prod-4&quot;}}}'
</code></pre>
