# Can I enforce a node to accept ONLY pods with a specific label or annotation?

**URL:** <https://discuss.kubernetes.io/t/can-i-enforce-a-node-to-accept-only-pods-with-a-specific-label-or-annotation/22911>\
**Category:** General Discussions\
**Created:** [February 1, 2023, 9:58am UTC](https://discuss.kubernetes.io/t/can-i-enforce-a-node-to-accept-only-pods-with-a-specific-label-or-annotation/22911 "2023-02-01T09:58:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Loic\_Quertenmont](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/loic_quertenmont/32/11419_2.png) [@Loic\_Quertenmont](https://discuss.kubernetes.io/u/Loic_Quertenmont)\
**Post date:** [February 1, 2023, 9:58am UTC](https://discuss.kubernetes.io/t/can-i-enforce-a-node-to-accept-only-pods-with-a-specific-label-or-annotation/22911/1 "2023-02-01T09:58:11Z")

</div>

Hi,

I know that I can enforce a pod being run on a node with specific label or annotation with a nodeSelector. But I’d like to have the opposite and making sure that no other pods could actually be run on my node.  
Is there a way to do this ?

Thanks in advance,  
Loic

### Cluster information:

Kubernetes version: 1.24  
Cloud being used: Aeure AKS

---

<div class="post-metadata">

**Author:** ![Loic\_Quertenmont](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/loic_quertenmont/32/11419_2.png) [@Loic\_Quertenmont](https://discuss.kubernetes.io/u/Loic_Quertenmont)\
**Post date:** [February 1, 2023, 2:49pm UTC](https://discuss.kubernetes.io/t/can-i-enforce-a-node-to-accept-only-pods-with-a-specific-label-or-annotation/22911/2 "2023-02-01T14:49:41Z")

</div>

Nevermind, I found the solution:

> **[Taints and Tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/)**
>
> Node affinity is a property of Pods that attracts them to a set of nodes (either as a preference or a hard requirement). Taints are the opposite -- they allow a node to repel a set of pods.
> Tolerations are applied to pods. Tolerations allow the...

Sorry for the news,  
Loic
