<p>Set the stain like this:</p>
<pre><code>    v3.patch_node('nodename',
                  {&quot;spec&quot;: {&quot;taints&quot;: [{&quot;effect&quot;: &quot;NoSchedule&quot;, &quot;key&quot;: &quot;test&quot;, &quot;value&quot;: &quot;1&quot;,'tolerationSeconds': '300'}]}}```

however.
How to remove tains?
</code></pre>

with zhang
<p>One more better way to untainted a particular taint. By doing this way other taints will not get removed.only a particular taint will ve untainted.</p>
<pre><code>def untaint_node(context, node_name, taint_key):
    Kube_client = setup_kube_client(context)
    node = Kube_client.list_nodes(field_selector={&quot;metadata.name&quot; : node_name}).items[0]
    taints = node.spec.taints
    filtered_taints = list(filter(lambda x: x.key != taint_key, taints))
    body = {&quot;spec&quot;: {&quot;taints&quot;: filtered_taints}}
    return kube_client.patch_node(node_name, body)
</code></pre>
