From 5a5c96b2ccfc2f8114e676ecf24148465cbac800 Mon Sep 17 00:00:00 2001 From: Meha Bhalodiya Date: Wed, 16 Jun 2021 11:11:15 +0530 Subject: [PATCH 1/3] Add tooltip for affinity --- .../scheduling-eviction/pod-priority-preemption.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/content/en/docs/concepts/scheduling-eviction/pod-priority-preemption.md b/content/en/docs/concepts/scheduling-eviction/pod-priority-preemption.md index 112e244f46..fe49f2acd4 100644 --- a/content/en/docs/concepts/scheduling-eviction/pod-priority-preemption.md +++ b/content/en/docs/concepts/scheduling-eviction/pod-priority-preemption.md @@ -252,12 +252,12 @@ Even so, the answer to the preceding question must be yes. If the answer is no, the Node is not considered for preemption. {{< /note >}} -If a pending Pod has inter-pod affinity to one or more of the lower-priority -Pods on the Node, the inter-Pod affinity rule cannot be satisfied in the absence -of those lower-priority Pods. In this case, the scheduler does not preempt any -Pods on the Node. Instead, it looks for another Node. The scheduler might find a -suitable Node or it might not. There is no guarantee that the pending Pod can be -scheduled. +If a pending Pod has inter-pod {{< glossary_tooltip text="affinity" term_id="affinity" >}} +to one or more of the lower-priority Pods on the Node, the inter-Pod affinity +rule cannot be satisfied in the absence of those lower-priority Pods. In this case, +the scheduler does not preempt any Pods on the Node. Instead, it looks for another +Node. The scheduler might find a suitable Node or it might not. There is no +guarantee that the pending Pod can be scheduled. Our recommended solution for this problem is to create inter-Pod affinity only towards equal or higher priority Pods. From 49e1c4b57995d721acc6c351333a0964f08af20a Mon Sep 17 00:00:00 2001 From: Meha Bhalodiya Date: Fri, 18 Jun 2021 16:26:02 +0530 Subject: [PATCH 2/3] Create affinity.md --- .../en/docs/reference/glossary/affinity.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 content/en/docs/reference/glossary/affinity.md diff --git a/content/en/docs/reference/glossary/affinity.md b/content/en/docs/reference/glossary/affinity.md new file mode 100644 index 0000000000..338320a48f --- /dev/null +++ b/content/en/docs/reference/glossary/affinity.md @@ -0,0 +1,19 @@ +--- +title: affinity +id: affinity +date: 2019-01-11 +full_link: /docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/ +short_description: > + Node affinity is a set of rules used by the scheduler to determine where a pod can be placed. +aka: +tags: +- core object +- fundamental +--- +Node affinity is a set of rules used by the scheduler to determine where a pod can be placed. + + + +The rules are defined using the familiar concepts of custom labels on {{< glossary_tooltip term_id="node" text="nodes">}} +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. From 53da9dfa2ae0b2b2a3e2e99358b798a049d6c32a Mon Sep 17 00:00:00 2001 From: Meha Bhalodiya Date: Fri, 18 Jun 2021 16:58:31 +0530 Subject: [PATCH 3/3] Update affinity.md --- content/en/docs/reference/glossary/affinity.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/content/en/docs/reference/glossary/affinity.md b/content/en/docs/reference/glossary/affinity.md index 338320a48f..e5cfc92ea2 100644 --- a/content/en/docs/reference/glossary/affinity.md +++ b/content/en/docs/reference/glossary/affinity.md @@ -1,19 +1,22 @@ --- -title: affinity +title: Affinity id: affinity date: 2019-01-11 -full_link: /docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/ +full_link: /docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity short_description: > - Node affinity is a set of rules used by the scheduler to determine where a pod can be placed. + Rules used by the scheduler to determine where to place pods aka: tags: -- core object - fundamental --- -Node affinity is a set of rules used by the scheduler to determine where a pod can be placed. + +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: +* [node affinity](/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity) +* [pod-to-pod affinity](/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity) -The rules are defined using the familiar concepts of custom labels on {{< glossary_tooltip term_id="node" text="nodes">}} +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.