NoSchedule is a Kubernetes taint effect that prevents new Pods from being scheduled on a tainted node unless their PodSpec includes a matching toleration. It suits special or lower-availability nodes that ordinary workloads should avoid by default. section 8.1.3
Use NoSchedule to:
- Reserve Spot or other special nodes for workloads that explicitly tolerate their taint. section 8.1.3
- Prefer a firm scheduling boundary over PreferNoSchedule, which creates only a soft rule and can complicate diagnosis. section 8.1.3
- Apply taints to node groups in hosted Kubernetes platforms so replacement nodes retain the policy. section 8.1.3
Tainting a Spot node
Run `kubectl taint nodes $NODE_NAME spot=true:NoSchedule`, then add a `spot=true` toleration to workloads allowed on that node. A workload without the toleration remains unscheduled there. section 8.1.3
$ minikube start --nodes 3 Done! kubectl is now configured to use "minikube" cluster $ kubectl get nodes NAME STATUS ROLES AGE VERSION minikube Ready control-plane 77s v1.24.3 minikube-m02 Ready <none> 55s v1.24.3 minikube-m03 NotReady <none> 19s v1.24.3 $ NODE_NAME=minikube-m02 $ kubectl taint nodes $NODE_NAME spot=true:NoSchedule node/minikube-m02 tainted
Inspect a Minikube cluster, identify a node, and apply a spot=true:NoSchedule taint. section 8.1.3
