<p>Say I have some special nodes in my cluster, and I want to be able to identify with a pod label all pods running on these nodes.</p>
<p>Taints &amp; tolerations are close to this, but afaik tolerations aren’t labels, they’re their own thing, and can’t be referenced in places where you expect a label selector, right? Is there any way to require all pods running on these nodes to identify themselves in a way that can then be queried via label selectors?</p>

<p>There are two parts of problem to solve:<br />
<strong>1. Ensure that pods with specific labels are scheduled to specific set of nodes.</strong><br />
This can be done by using custom scheduler or a plugin for default scheduler (more <a href="https://kubernetes.io/docs/tasks/extend-kubernetes/configure-multiple-schedulers/" rel="nofollow noreferrer">here</a>, <a href="https://kubernetes.io/docs/concepts/scheduling-eviction/scheduling-framework/" rel="nofollow noreferrer">here</a>, <a href="https://developer.ibm.com/technologies/containers/articles/creating-a-custom-kube-scheduler/" rel="nofollow noreferrer">here</a>, <a href="https://github.com/IBM/k8s-custom-scheduler" rel="nofollow noreferrer">here</a> and <a href="https://github.com/kubernetes-sigs/scheduler-plugins" rel="nofollow noreferrer">here</a>).</p>
<p><strong>2. Prevent other schedulers to schedule pods to that nodes</strong><br />
This can by achieved by using <code>nodeAffinity</code> or node taints (more <a href="https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-isolation-restriction" rel="nofollow noreferrer">here</a> and <a href="https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/" rel="nofollow noreferrer">here</a>)</p>
<p>A complete solution may require additional apiserver admission controller to set all those properties to a pod that suppose to have a specific label only.<br />
Unfortunately, there is no easy built-in solution as of yet. Hopefuly the above will point you in the right direction.</p>
