<p>I am using Kubectl run command to execute pod on a specific node.</p>
<pre><code>kubectl --namespace=ns run pod1 --image image1 \
  --overrides='{&quot;spec&quot;:{&quot;nodeSelector&quot;:{&quot;appgroup&quot;:&quot;app1&quot;}}}' \
  --command python3 script.py
</code></pre>
<p>Sometimes pod is going on pending status and it cannot progress to running phase.</p>
<p>How can I add tolerations to the run command?</p>
<p>Note: I do not have a yaml file.</p>
<p>Any help is appreciated</p>

Pons
<p>You can do this adding a &quot;tolerations&quot; array.</p>
<p>If you want to ignore all tolerations, we can do this with an &quot;operator=exists&quot; condition.</p>
<pre><code>kubectl --namespace=$your_ns run $your_pod --image $your_image \
  --overrides='{&quot;spec&quot;:{&quot;nodeSelector&quot;:{&quot;appgroup&quot;:&quot;app1&quot;},&quot;tolerations&quot;:[{&quot;operator&quot;:&quot;exists&quot;}]}}' \
  --command python3 script.py \
  [--dry-run=client -o yaml]
</code></pre>
<p>Also note: if you want to use a YAML file, the &quot;dry-run&quot; and &quot;-o yaml&quot; option would help you generate a first copy. Maybe you would be more comfortable with a plaintext file testing your changes.</p>
