Missing description in the podAffinity
concept documentation
#47922
Labels
kind/bug
Categorizes issue or PR as related to a bug.
language/en
Issues or PRs related to English language
priority/important-longterm
Important over the long term, but may not be staffed and/or may need multiple releases to complete.
sig/docs
Categorizes an issue or PR as relevant to SIG Docs.
sig/scheduling
Categorizes an issue or PR as relevant to SIG Scheduling.
triage/accepted
Indicates an issue or PR is ready to be actively worked on.
This is a Bug Report
Problem:
We noticed some information is missing in the concept documentation about how existing pods' podAffinity/podAntiAffinity fields affect the scheduling decision for each incoming pod. This makes it difficult to understand how the scheduler respects different affinity rules when making scheduling decisions.
In detail, there're two types of pod affinity rules, namely
podAffnity
andpodAntiAffinity
, and within each type, there arerequiredDuringSchedulingIgnoredDuringExecution
andpreferredDuringSchedulingIgnoredDuringExecution
. So, each pod has in total four fields for pod affinity rules:podAffinity.requiredDuringSchedulingIgnoredDuringExecution
podAffinity.preferredDuringSchedulingIgnoredDuringExecution
podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution
podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution
By reading the code we found that the scheduler also needs to consider such fields of existing pods in the cluster when making the decision for each incoming pod:
podAffinity.requiredDuringSchedulingIgnoredDuringExecution
podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution
podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution
podAffinity.preferredDuringSchedulingIgnoredDuringExecution
podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution
podAffinity.requiredDuringSchedulingIgnoredDuringExecution
podAffinity.preferredDuringSchedulingIgnoredDuringExecution
podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution
However, the documentation does not mention how the existing pods'
podAffinity
andpodAntiAffinity
affect the scheduling decision.Proposed Solution:
We suggest to add the following information to the concept documentation, and also the API specification:
podAffinity/podAntiAffinity
's required parts will also be considered when scheduling.podAntiAffinity
's required part will be considered as hard constraints, and nodes will be filtered out if not matching this.podAffinity
's required part will be considered as soft constraints, and nodes will be scored based this.podAffinity/podAntiAffinity
's preferred parts will not be considered when scheduling.Page to Update:
https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
https://github.com/kubernetes/website/blob/main/content/en/docs/concepts/scheduling-eviction/assign-pod-node.md
/sig scheduling docs
/language en
The text was updated successfully, but these errors were encountered: