website/content/en/docs/reference/glossary/affinity.md

947 B

title id date full_link short_description aka tags
Affinity affinity 2019-01-11 /docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity Rules used by the scheduler to determine where to place pods
fundamental

In Kubernetes, affinity is a set of rules that give hints to the scheduler about where to place pods.

There are two kinds of affinity:

The rules are defined using the Kubernetes {{< glossary_tooltip term_id="label" text="labels">}}, and {{< glossary_tooltip term_id="selector" text="selectors">}} specified in {{< glossary_tooltip term_id="pod" text="pods" >}}, and they can be either required or preferred, depending on how strictly you want the scheduler to enforce them.