concept

Node Affinity

Node Affinity is a Kubernetes scheduling feature that allows users to constrain which nodes a pod can be scheduled onto based on node labels. It provides a way to express pod placement preferences or requirements, such as running pods on nodes with specific hardware, location, or other attributes. This helps optimize resource utilization, improve performance, or meet compliance needs by influencing where workloads run in a cluster.

Also known as: Kubernetes Node Affinity, Pod Node Affinity, NodeSelector (related but simpler), Node Affinity Rules, K8s Node Affinity
🧊Why learn Node Affinity?

Developers should learn Node Affinity when deploying applications in Kubernetes that require specific node characteristics, such as running on nodes with GPUs for machine learning workloads, high-memory nodes for databases, or nodes in particular availability zones for fault tolerance. It is essential for fine-grained control over pod placement to meet performance, cost, or regulatory requirements, especially in heterogeneous or multi-zone clusters.

Compare Node Affinity

Learning Resources

Related Tools

Alternatives to Node Affinity