-
Notifications
You must be signed in to change notification settings - Fork 1.6k
KEP-3243: Update the design to mutate the label selector based on matchLabelKeys at api-server instead of the scheduler handling it #5033
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
7a89964
c6e0a76
4906e22
ecd8737
eea447d
820dcf8
688ecc1
74642f9
7d90a4b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -87,7 +87,10 @@ tags, and then generate with `hack/update-toc.sh`. | |||||||
| - [Story 1](#story-1) | ||||||||
| - [Notes/Constraints/Caveats (Optional)](#notesconstraintscaveats-optional) | ||||||||
| - [Risks and Mitigations](#risks-and-mitigations) | ||||||||
| - [Possible misuse](#possible-misuse) | ||||||||
| - [the update to labels specified at <code>matchLabelKeys</code> isn't supported](#the-update-to-labels-specified-at-matchlabelkeys-isnt-supported) | ||||||||
| - [Design Details](#design-details) | ||||||||
| - [[v1.33] design change and a safe upgrade path](#v133-design-change-and-a-safe-upgrade-path) | ||||||||
| - [Test Plan](#test-plan) | ||||||||
| - [Prerequisite testing updates](#prerequisite-testing-updates) | ||||||||
| - [Unit tests](#unit-tests) | ||||||||
|
|
@@ -109,6 +112,8 @@ tags, and then generate with `hack/update-toc.sh`. | |||||||
| - [Implementation History](#implementation-history) | ||||||||
| - [Drawbacks](#drawbacks) | ||||||||
| - [Alternatives](#alternatives) | ||||||||
| - [use pod generateName](#use-pod-generatename) | ||||||||
| - [implement MatchLabelKeys in only either the scheduler plugin or kube-apiserver](#implement-matchlabelkeys-in-only-either-the-scheduler-plugin-or-kube-apiserver) | ||||||||
| - [Infrastructure Needed (Optional)](#infrastructure-needed-optional) | ||||||||
| <!-- /toc --> | ||||||||
|
|
||||||||
|
|
@@ -179,10 +184,11 @@ which spreading is applied using a LabelSelector. This means the user should | |||||||
| know the exact label key and value when defining the pod spec. | ||||||||
|
|
||||||||
| This KEP proposes a complementary field to LabelSelector named `MatchLabelKeys` in | ||||||||
| `TopologySpreadConstraint` which represent a set of label keys only. The scheduler | ||||||||
| will use those keys to look up label values from the incoming pod; and those key-value | ||||||||
| labels are ANDed with `LabelSelector` to identify the group of existing pods over | ||||||||
| `TopologySpreadConstraint` which represent a set of label keys only. | ||||||||
| kube-apiserver will use those keys to look up label values from the incoming pod | ||||||||
|
||||||||
| kube-apiserver will use those keys to look up label values from the incoming pod | |
| At a pod creation, kube-apiserver will use those keys to look up label values from the incoming pod |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| and those key-value labels are ANDed with `LabelSelector` to identify the group of existing pods over | |
| and those key-value labels will be merged with existing `LabelSelector` to identify the group of existing pods over |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| kube-scheduler will also handle it if the cluster-level default constraints have the one with `MatchLabelKeys`. | |
| Note that in case `MatchLabelKeys`is supported in the cluster-level default constraints (see https://github.com/kubernetes/kubernetes/issues/129198), kube-scheduler will also handle it separately. |
mochizuki875 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| It means this feature doesn't support the label's update even though users, of course, | |
| It means this feature doesn't support the label's update even though a user | |
| could update the label that is specified at `matchLabelKeys` after a pod's creation. |
mochizuki875 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather say that updating labels used is not recommended at all (instead of updating frequently), as it would break the original placement of such pods.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it true? Even if the labelSelector no longer matches the pod itself, the topology spreading is not ignored and could still make the pod unschedulable (ofc selfMatchNum will be 0). If it's what you mean, I'd rephrase it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't simply the label change become ignored? Does the pod itself need to be covered by the selector? I think the bigger problem is that since we'd have both implementations (in api-server and scheduler), won't scheduler add new label ot the labelSelecor and make the pod completely unschedulable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it true? Even if the labelSelector no longer matches the pod itself, the topology spreading is not ignored and could still make the pod unschedulable (ofc selfMatchNum will be 0). If it's what you mean, I'd rephrase it.
Yeah, sorry it's my suggestion and you're right, "ignored" was misleading and we should rephrase; matchNum - minMatchNum could still be bigger than maxSkew and node(s) in some domains could be unschedulable, depending on the current number of matching pods there.
won't scheduler add new label ot the labelSelecor and make the pod completely unschedulable?
The scheduler adds, but the pod won't be completely unschedulable. Rather, the label addition in this case makes the pod easier to get scheduled because selfMatchNum would be 0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your comments.
I've tried to rephrase this sentence.
mochizuki875 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
mochizuki875 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it only a proposal? kubernetes/kubernetes#129198 (comment)
mochizuki875 marked this conversation as resolved.
Show resolved
Hide resolved
mochizuki875 marked this conversation as resolved.
Show resolved
Hide resolved
mochizuki875 marked this conversation as resolved.
Show resolved
Hide resolved
mochizuki875 marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can add that this is the actual implementation up to 1.32
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| impossible to handle `MatchLabelKeys` within the cluster-level default constraints in the scheduler configuration. | |
| impossible to handle `MatchLabelKeys` within the cluster-level default constraints in the scheduler configuration in the future (see https://github.com/kubernetes/kubernetes/issues/129198). |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| So we decided to go with the current design that implements this feature within both | |
| So we decided to go with the design that implements this feature within both |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.