Kubernetes (K8s) (50 Qs)•Part 3: Advanced Internals, Scale & Production Security (Senior / Lead)
Pod Placement Controls: Node Affinity, Taints, and Tolerations.
senior LevelMost AskedSecurity & AuthKubernetes
In Simple Words:
- NodeSelector: Basic key-value matching to place pods on specific labeled nodes (
disk: ssd). - Node Affinity (
requiredDuringScheduling...vspreferred...): Expressive rules supporting boolean logic, operators (In,NotIn), and soft preferences. - Taints & Tolerations: A Taint on a node (
gpu=true:NoSchedule) repels Pods. Only Pods with a matching Toleration are permitted to schedule on that node, dedicating expensive GPU nodes to AI/ML workloads.