<p>I would like to apply the tolerations on the Jenkins slave pod that are dynamically spinned by the Kubernetes Plugin. I see that the Kubernetes Plugin does not provide any option on the Jenkins UI to add the tolerations, as shown in the image below. Could anyone tell me, how can I add the tolerations in this case to the slave pods(which are generated by kubernetes plugin). </p>

<p>P.S.:- I do not want to use labels,I Strictly want to use tolerations. And I am not sure if I want to add the podTemplate in the Jenkinsfile and specify the tolerations in this podTemplate. Because this will force me to do the same for every job's Jenkinsfile, which is tedious and not possible if multiple developers prepare their own respective pipelines.<a href="https://i.stack.imgur.com/r0lKJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/r0lKJ.png" alt="enter image description here"></a> </p>

<p>You can actually add taints to the configs in jenkins outright.</p>

<p><a href="https://github.com/jenkinsci/kubernetes-plugin/pull/311#issuecomment-386342776" rel="noreferrer">https://github.com/jenkinsci/kubernetes-plugin/pull/311#issuecomment-386342776</a></p>

<p>You can add this into the "raw yaml for the pod" under your container and update your criteria accordingly for the labels.  </p>

<p>I have used this myself and it does indeed work.</p>

<p>(here's the yaml from the link above)</p>

<pre><code>apiVersion: v1
kind: Pod
metadata:
  labels:
    jenkins/kube-default: true
    app: jenkins
    component: agent
spec:
  nodeSelector:
    werkint.com/entity: other
  tolerations:
  - key: werkint.com/entity
    operator: Equal
    value: other
    effect: NoSchedule
</code></pre>
