KB: Kubernetes Affinity
Affinity rules in Kubernetes are constraints that influence the scheduling of pods based on certain conditions. These rules help you control the placement of pods on nodes or in relation to other pods, ensuring optimal performance, resource utilization, and reliability. Affinity rules come in three main types: node affinity, pod affinity, and pod anti-affinity.
Practical Use Cases
Practical Use Cases
- Node Affinity: Ensuring pods with high memory requirements are scheduled on nodes with high memory capacity.
- Pod Affinity: Scheduling web servers close to caching servers to reduce latency.
- Pod Anti-Affinity: Spreading replicas of a service across different nodes to ensure high availability.
Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector
Comments
Post a Comment