A taint marks a node as unsuitable for Pods that lack a matching toleration. It repels workloads; a node label instead gives a Pod’s selector or affinity rule a way to target nodes. Use a taint when a node should be reserved for a class of workloads, such as applications requiring a GPU. Use a label when a workload needs to find a capability, such as fast local storage. A toleration permits placement on a tainted node but does not, by itself, direct the Pod there. section 3.2.7 section 3.4.1
Choose the taint effect according to the scheduling consequence required:
- NoSchedule prevents a Pod without a matching toleration from being scheduled on the node. section 3.2.7
- PreferNoSchedule asks the scheduler to avoid placing a Pod without a matching toleration there. section 3.2.7
- NoExecute evicts an already-running Pod that does not match when the taint is added. section 3.2.7
Reserve a GPU node
In a three-zone GKE cluster, ordinary workloads may run in two zones, while nodes in the GPU zone are reserved for GPU-requiring workloads. Apply `kubectl taint node <gpu-node> workload=gpu:NoSchedule` to each reserved node, then label those nodes `workload=gpu`. A Pod intended for that zone uses `nodeSelector: {workload: gpu}` and a toleration with key `workload`, operator `Equal`, value `gpu`, and effect `NoSchedule`. The selector targets the labeled node; the toleration lets the Pod pass its taint. Check the resulting node assignment in the Pod listing. section 3.4.1
Taints and tolerations are among the criteria used by the default kube-scheduler, alongside node affinity and selectors. Set the restriction on nodes and the matching permission in Pod configuration; do not mistake permission to run on a reserved node for a requirement to run there. section 3.2.7 section 3.3.2



