# Prevent pod from scheduling if no node selector or affinity

**URL:** https://discuss.kubernetes.io/t/prevent-pod-from-scheduling-if-no-node-selector-or-affinity/28796
**Category:** General Discussions
**Created:** [June 26, 2024, 9:36am UTC](https://discuss.kubernetes.io/t/prevent-pod-from-scheduling-if-no-node-selector-or-affinity/28796 "2024-06-26T09:36:22Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![mikhatanu](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/mikhatanu/32/11744_2.png) [@mikhatanu](https://discuss.kubernetes.io/u/mikhatanu)
#### Post date: [June 26, 2024, 9:36am UTC](https://discuss.kubernetes.io/t/prevent-pod-from-scheduling-if-no-node-selector-or-affinity/28796/1 "2024-06-26T09:36:23Z")

</div>

Hello, is it possible to force node selector or node affinity to pods so only pods with node selector or affinity is allowed to schedule or execute?

---

<div class="post-metadata">

### Author: ![thockin](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/thockin/32/2457_2.png) [@thockin](https://discuss.kubernetes.io/u/thockin)
#### Post date: [June 26, 2024, 2:56pm UTC](https://discuss.kubernetes.io/t/prevent-pod-from-scheduling-if-no-node-selector-or-affinity/28796/2 "2024-06-26T14:56:12Z")

</div>

Validating admission policy?
