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
Copy file name to clipboardExpand all lines: keps/sig-scheduling/3633-matchlabelselectors-to-podaffinity/README.md
+11-9Lines changed: 11 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -246,7 +246,7 @@ and they want only replicas from the same replicaset to be evaluated.
246
246
247
247
The deployment controller adds [pod-template-hash](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#pod-template-hash-label) to underlying ReplicaSet and thus every Pod created from Deployment carries the hash string.
248
248
249
-
Therefore, users can use `pod-template-hash` in `matchLabelSelector.matchLabelKeys` to inform the scheduler to only evaluate Pods with the same `pod-template-hash` value.
249
+
Therefore, users can use `pod-template-hash` in `matchLabelSelector.Key` to inform the scheduler to only evaluate Pods with the same `pod-template-hash` value.
250
250
251
251
```yaml
252
252
apiVersion: apps/v1
@@ -265,7 +265,7 @@ metadata:
265
265
- database
266
266
topologyKey: topology.kubernetes.io/zone
267
267
matchLabelSelectors: # ADDED
268
-
- matchLabelKeys: pod-template-hash
268
+
- Key: pod-template-hash
269
269
operator: In
270
270
```
271
271
@@ -281,13 +281,13 @@ affinity:
281
281
podAffinity: # ensures the pods of this tenant land on the same node pool
282
282
requiredDuringSchedulingIgnoredDuringExecution:
283
283
- matchLabelSelectors:
284
-
- matchLabelKey: tenant
284
+
- Key: tenant
285
285
operator: In
286
286
topologyKey: node-pool
287
287
podAntiAffinity: # ensures only Pods from this tenant lands on the same node pool
288
288
requiredDuringSchedulingIgnoredDuringExecution:
289
289
- matchLabelSelectors:
290
-
- matchLabelKey: tenant
290
+
- Key: tenant
291
291
operator: NotIn
292
292
- labelSelector:
293
293
matchExpressions:
@@ -326,7 +326,7 @@ Consider including folks who also work outside the SIG or subproject.
326
326
-->
327
327
328
328
In addition to using `pod-template-hash` added by the Deployment controller,
329
-
users can also provide the customized key in `MatchLabelKey` to identify
329
+
users can also provide the customized key in `MatchLabelSelectors.Key` to identify
330
330
which pods should be grouped. If so, the user needs to ensure that it is
331
331
correct and not duplicated with other unrelated workloads.
332
332
@@ -345,11 +345,11 @@ A new optional field `MatchLabelSelectors` is introduced to `PodAffinityTerm`.
345
345
type LabelSelectorOperator string
346
346
347
347
type MatchLabelSelector struct {
348
-
// MatchLabelKey is used to lookup value from the incoming pod labels,
348
+
// Key is used to lookup value from the incoming pod labels,
349
349
// and that key-value label is merged with `LabelSelector`.
350
350
// Key that doesn't exist in the incoming pod labels will be ignored.
351
-
MatchLabelKey string
352
-
// Operator defines how key-value, fetched via the above `MatchLabelKeys`, is merged into LabelSelector.
351
+
Key string
352
+
// Operator defines how key-value, fetched via the above `Keys`, is merged into LabelSelector.
353
353
// If Operator is `In`, `key in (value)` is merged with LabelSelector.
354
354
// If Operator is `NotIn`, `key notin (value)` is merged with LabelSelector.
355
355
//
@@ -372,7 +372,7 @@ type PodAffinityTerm struct {
372
372
```
373
373
374
374
The inter-Pod Affinity plugin will obtain the labels from the pod
375
-
labels by the key in `MatchLabelKey`.
375
+
labels by the key in `MatchLabelSelectors.Key`.
376
376
377
377
The obtained labels will be merged to `LabelSelector` of `PodAffinityTerm` depending on `Operator`.
378
378
- If Operator is `In`, `key in (value)` is merged with LabelSelector.
@@ -961,6 +961,8 @@ not need to be as detailed as the proposal, but should include enough
961
961
information to express the idea and why it was not acceptable.
0 commit comments