You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This KEP proposes introducing a complementary field `MatchLabelSelectors` to `PodAffinityTerm`.
181
+
This KEP proposes introducing a complementary field `MatchLabelKeys` to `PodAffinityTerm`.
182
182
This enables users to finely control the scope where Pods are expected to co-exist (PodAffinity)
183
183
or not (PodAntiAffinity), on top of the existing `LabelSelector`.
184
184
@@ -210,7 +210,7 @@ The same issue applies to other scheduling directives as well. For example, Matc
210
210
211
211
### Goals
212
212
213
-
- Introduce `MatchLabelSelectors` in `PodAffinityTerm` to let users define the scope where Pods are evaluated in required and preferred Pod(Anti)Affinity.
213
+
- Introduce `MatchLabelKeys` and `MismatchLabelKeys` in `PodAffinityTerm` to let users define the scope where Pods are evaluated in required and preferred Pod(Anti)Affinity.
214
214
215
215
### Non-Goals
216
216
@@ -219,7 +219,7 @@ What is out of scope for this KEP? Listing non-goals helps to focus discussion
219
219
and make progress.
220
220
-->
221
221
222
-
- Apply additional internal labels when evaluating `MatchLabelSelectors`
222
+
- Apply additional internal labels when evaluating `MatchLabelKeys` or `MismatchLabelKeys`
223
223
224
224
## Proposal
225
225
@@ -266,9 +266,8 @@ metadata:
266
266
values:
267
267
- database
268
268
topologyKey: topology.kubernetes.io/zone
269
-
matchLabelSelectors: # ADDED
270
-
- key: pod-template-hash
271
-
operator: In
269
+
matchLabelKeys: # ADDED
270
+
- pod-template-hash
272
271
```
273
272
274
273
#### Story 2
@@ -282,15 +281,13 @@ By applying the following affinity globally using a mutating webhook, the cluste
282
281
affinity:
283
282
podAffinity: # ensures the pods of this tenant land on the same node pool
284
283
requiredDuringSchedulingIgnoredDuringExecution:
285
-
- matchLabelSelectors:
286
-
- key: tenant
287
-
operator: In
284
+
- matchLabelKeys:
285
+
- tenant
288
286
topologyKey: node-pool
289
287
podAntiAffinity: # ensures only Pods from this tenant lands on the same node pool
290
288
requiredDuringSchedulingIgnoredDuringExecution:
291
-
- matchLabelSelectors:
292
-
- key: tenant
293
-
operator: NotIn
289
+
- mismatchLabelKeys:
290
+
- tenant
294
291
labelSelector:
295
292
matchExpressions:
296
293
- key: tenant
@@ -328,7 +325,7 @@ Consider including folks who also work outside the SIG or subproject.
328
325
-->
329
326
330
327
In addition to using `pod-template-hash` added by the Deployment controller,
331
-
users can also provide the customized key in `MatchLabelSelectors.Key` to identify
328
+
users can also provide the customized key in `matchLabelKeys` to identify
332
329
which pods should be grouped. If so, the user needs to ensure that it is
333
330
correct and not duplicated with other unrelated workloads.
334
331
@@ -341,17 +338,9 @@ required) or even code snippets. If there's any ambiguity about HOW your
341
338
proposal will be implemented, this is the place to discuss them.
342
339
-->
343
340
344
-
A new optional field `MatchLabelSelectors` is introduced to `PodAffinityTerm`.
341
+
A new optional fields `matchLabelKeys` and `mismatchLabelKeys` are introduced to `PodAffinityTerm`.
345
342
346
343
```go
347
-
type LabelSelectorOperator string
348
-
349
-
// Only `In` and `NotIn` are expected for LabelSelectorOperator.
0 commit comments