Affinity ルールとは?
affinity ルールは scheduling における引力を表現し、特定の label を持つ node や、セレクターに一致する pod のそばに pod を配置することを scheduler に優先させたり要求したりします。必ず満たす必要がある required 形式と、ソフトな重み付けである preferred 形式があります。近接していることで恩恵を受ける workload を同じ場所に配置できます。
なぜ重要か
affinity はレイテンシに敏感な pod を一緒に、あるいは特殊なハードウェアの node に固定できます。ただし過度に厳格な required ルールは、pod をスケジュール不能な状態にしてしまうことがあります。
関連ガイド
What Is Anti-Affinity?Anti-affinity tells the scheduler to keep matching pods apart, for example spreading replicas onto different…
What Is Pod Topology Spread?Pod topology spread constraints tell the scheduler to distribute matching pods evenly across domains like zon…
What Is a Descheduler?A descheduler periodically evicts pods that are now sub-optimally placed so the scheduler can reposition them…