Skip to content

Commit 15728ec

Browse files
committed
change: merge MatchLabelSelector in kube-apiserver
1 parent 6bd1c2b commit 15728ec

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

keps/sig-scheduling/3633-matchlabelselectors-to-podaffinity/README.md

+7-9
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ metadata:
267267
- database
268268
topologyKey: topology.kubernetes.io/zone
269269
matchLabelSelectors: # ADDED
270-
- Key: pod-template-hash
270+
- key: pod-template-hash
271271
operator: In
272272
```
273273
@@ -283,13 +283,13 @@ affinity:
283283
podAffinity: # ensures the pods of this tenant land on the same node pool
284284
requiredDuringSchedulingIgnoredDuringExecution:
285285
- matchLabelSelectors:
286-
- Key: tenant
286+
- key: tenant
287287
operator: In
288288
topologyKey: node-pool
289289
podAntiAffinity: # ensures only Pods from this tenant lands on the same node pool
290290
requiredDuringSchedulingIgnoredDuringExecution:
291291
- matchLabelSelectors:
292-
- Key: tenant
292+
- key: tenant
293293
operator: NotIn
294294
- labelSelector:
295295
matchExpressions:
@@ -373,10 +373,8 @@ type PodAffinityTerm struct {
373373
}
374374
```
375375

376-
The inter-Pod Affinity plugin will obtain the labels from the pod
377-
labels by the key in `MatchLabelSelectors.Key`.
378-
379-
The obtained labels will be merged to `LabelSelector` of `PodAffinityTerm` depending on `Operator`.
376+
When a Pod is created, kube-apiserver will obtain the labels from the pod
377+
labels by the key in `MatchLabelSelectors.Key`, and merge to `LabelSelector` of `PodAffinityTerm` depending on `Operator`:
380378
- If Operator is `In`, `key in (value)` is merged with LabelSelector.
381379
- If Operator is `NotIn`, `key notin (value)` is merged with LabelSelector.
382380

@@ -639,7 +637,7 @@ well as the [existing list] of feature gates.
639637

640638
- [x] Feature gate (also fill in values in `kep.yaml`)
641639
- Feature gate name: `MatchLabelSelectorsInPodAffinity`
642-
- Components depending on the feature gate: `kube-scheduler`, `kube-apiserver`
640+
- Components depending on the feature gate: `kube-apiserver`
643641
- [ ] Other
644642

645643
###### Does enabling the feature change any default behavior?
@@ -665,7 +663,7 @@ NOTE: Also set `disable-supported` to `true` or `false` in `kep.yaml`.
665663
-->
666664

667665
The feature can be disabled in Alpha and Beta versions
668-
by restarting kube-apiserver and kube-scheduler with the feature-gate off.
666+
by restarting kube-apiserver the feature-gate off.
669667
In terms of Stable versions, users can choose to opt-out by not setting the
670668
`MatchLabelSelectors` field.
671669

keps/sig-scheduling/3633-matchlabelselectors-to-podaffinity/kep.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
title: Introduce MatchLabelKeys to PodAffinity and PodAntiAffinity
1+
title: Introduce MatchLabelSelectors to PodAffinity and PodAntiAffinity
22
kep-number: 3633
33
authors:
44
- "@sanposhiho"
@@ -25,5 +25,5 @@ milestone:
2525
feature-gates:
2626
- name: MatchLabelSelectorsInPodAffinity
2727
components:
28-
- kube-scheduler
28+
- kube-apiserver
2929
disable-supported: true

0 commit comments

Comments
 (0)