Skip to content

Commit 39ebbdc

Browse files
committed
Update milestone v1.33 to v1.34 and add feature gate for #129874
1 parent f3fa3a1 commit 39ebbdc

File tree

2 files changed

+29
-11
lines changed
  • keps/sig-scheduling/3243-respect-pod-topology-spread-after-rolling-upgrades

2 files changed

+29
-11
lines changed

keps/sig-scheduling/3243-respect-pod-topology-spread-after-rolling-upgrades/README.md

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ tags, and then generate with `hack/update-toc.sh`.
9090
- [Possible misuse](#possible-misuse)
9191
- [The update to labels specified at <code>matchLabelKeys</code> isn't supported](#the-update-to-labels-specified-at-matchlabelkeys-isnt-supported)
9292
- [Design Details](#design-details)
93-
- [[v1.33] design change and a safe upgrade path](#v133-design-change-and-a-safe-upgrade-path)
93+
- [[v1.34] design change and a safe upgrade path](#v134-design-change-and-a-safe-upgrade-path)
9494
- [Test Plan](#test-plan)
9595
- [Prerequisite testing updates](#prerequisite-testing-updates)
9696
- [Unit tests](#unit-tests)
@@ -401,25 +401,28 @@ kube-apiserver modifies the `labelSelector` like the following:
401401
In addition, kube-scheduler will handle `matchLabelKeys` within the cluster-level default constraints
402402
in the scheduler configuration in the future (see https://github.com/kubernetes/kubernetes/issues/129198).
403403

404-
Finally, the feature will be guarded by a new feature flag. If the feature is
404+
Finally, the feature will be guarded by a new feature flag `MatchLabelKeysInPodTopologySpread`. If the feature is
405405
disabled, the field `matchLabelKeys` and corresponding `labelSelector` are preserved
406406
if it was already set in the persisted Pod object, otherwise new Pod with the field
407407
creation will be rejected by kube-apiserver.
408408
Also kube-scheduler will ignore `matchLabelKeys` in the cluster-level default constraints configuration.
409409

410-
### [v1.33] design change and a safe upgrade path
410+
### [v1.34] design change and a safe upgrade path
411411
Previously, kube-scheduler just internally handled `matchLabelKeys` before the calculation of scheduling results.
412412
But, we changed the implementation design to the current form to make the design align with PodAffinity's `matchLabelKeys`.
413413
(See the detailed discussion in [the alternative section](#implement-matchlabelkeys-in-only-either-the-scheduler-plugin-or-kube-apiserver))
414414

415415
However, this implementation change could break `matchLabelKeys` of unscheduled pods created before the upgrade
416416
because kube-apiserver only handles `matchLabelKeys` at pods creation, that is,
417417
it doesn't handle `matchLabelKeys` at existing unscheduled pods.
418-
So, for a safe upgrade path from v1.32 to v1.33, kube-scheduler would handle not only `matchLabelKeys`
419-
from the default constraints, but also all incoming pods during v1.33.
420-
We're going to change kube-scheduler to only concern `matchLabelKeys` from the default constraints at v1.34 for efficiency,
418+
So, for a safe upgrade path from v1.33 to v1.34, kube-scheduler would handle not only `matchLabelKeys`
419+
from the default constraints, but also all incoming pods during v1.34.
420+
We're going to change kube-scheduler to only concern `matchLabelKeys` from the default constraints at v1.35 for efficiency,
421421
assuming kube-apiserver handles `matchLabelKeys` of all incoming pods.
422422

423+
This implementation change can be disabled by the `MatchLabelKeysInPodTopologySpreadSelectorMerge` feature flag.
424+
(See more details in [Feature Enablement and Rollback](#feature-enablement-and-rollback))
425+
423426
### Test Plan
424427

425428
<!--
@@ -619,8 +622,8 @@ enhancement:
619622

620623
There's no version skew issue.
621624

622-
We changed the implementation design between v1.33 and v1.34, but we designed the change not to involve any version skew issue
623-
as described at [[v1.33] design change and a safe upgrade path](#v133-design-change-and-a-safe-upgrade-path).
625+
We changed the implementation design between v1.34 and v1.35, but we designed the change not to involve any version skew issue
626+
as described at [[v1.34] design change and a safe upgrade path](#v134-design-change-and-a-safe-upgrade-path).
624627

625628
## Production Readiness Review Questionnaire
626629

@@ -652,6 +655,15 @@ you need any help or guidance.
652655
This section must be completed when targeting alpha to a release.
653656
-->
654657

658+
- `MatchLabelKeysInPodTopologySpread` feature flag will toggle enabling `MatchLabelKeys` in `TopologySpreadConstraint`.
659+
- `MatchLabelKeysInPodTopologySpreadSelectorMerge` feature flag will toggle merging the key-value labels
660+
corresponding to `MatchLabelKeys` into `LabelSelector` of `TopologySpreadConstraint`.
661+
This flag cannot be enabled on its own, and has to be enabled together with `MatchLabelKeysInPodTopologySpread`.
662+
663+
The `MatchLabelKeysInPodTopologySpreadSelectorMerge` feature flag has been added in v1.34 and enabled by default.
664+
This flag can be disabled to revert [the implementation design change in v1.34](#v134-design-change-and-a-safe-upgrade-path)
665+
and go back to the previous behavior.
666+
655667
###### How can this feature be enabled / disabled in a live cluster?
656668

657669
<!--
@@ -667,6 +679,9 @@ well as the [existing list] of feature gates.
667679
- [x] Feature gate (also fill in values in `kep.yaml`)
668680
- Feature gate name: `MatchLabelKeysInPodTopologySpread`
669681
- Components depending on the feature gate: `kube-scheduler`, `kube-apiserver`
682+
- [x] Feature gate (also fill in values in `kep.yaml`)
683+
- Feature gate name: `MatchLabelKeysInPodTopologySpreadSelectorMerge`
684+
- Components depending on the feature gate: `kube-apiserver`
670685

671686
###### Does enabling the feature change any default behavior?
672687

@@ -1086,7 +1101,7 @@ and scheduler plugin shouldn't have special treatment for any labels/fields.
10861101
Technically, we can implement this feature within the PodTopologySpread plugin only;
10871102
merging the key-value labels corresponding to `MatchLabelKeys` into `LabelSelector` internally
10881103
within the plugin before calculating the scheduling results.
1089-
This is the actual implementation up to 1.32.
1104+
This is the actual implementation up to 1.33.
10901105
But, it may confuse users because this behavior would be different from PodAffinity's `MatchLabelKeys`.
10911106

10921107
Also, we cannot implement this feature only within kube-apiserver because it'd make it

keps/sig-scheduling/3243-respect-pod-topology-spread-after-rolling-upgrades/kep.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ stage: beta
2222
# The most recent milestone for which work toward delivery of this KEP has been
2323
# done. This can be the current (upcoming) milestone, if it is being actively
2424
# worked on.
25-
latest-milestone: "v1.33"
25+
latest-milestone: "v1.34"
2626

2727
# The milestone at which this feature was, or is targeted to be, at each stage.
2828
milestone:
2929
alpha: "v1.25"
3030
beta: "v1.27"
31-
stable: "v1.35"
31+
stable: "v1.36"
3232

3333
# The following PRR answers are required at alpha release
3434
# List the feature gate name and the components for which it must be enabled
@@ -37,6 +37,9 @@ feature-gates:
3737
components:
3838
- kube-apiserver
3939
- kube-scheduler
40+
- name: MatchLabelKeysInPodTopologySpreadSelectorMerge
41+
components:
42+
- kube-apiserver
4043

4144
disable-supported: true
4245

0 commit comments

Comments
 (0)