Skip to content

Commit 6e85741

Browse files
committed
rename matchLabelKey to key
1 parent c2e4714 commit 6e85741

File tree

1 file changed

+11
-9
lines changed
  • keps/sig-scheduling/3633-matchlabelselectors-to-podaffinity

1 file changed

+11
-9
lines changed

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

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ and they want only replicas from the same replicaset to be evaluated.
246246

247247
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.
248248

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.
250250

251251
```yaml
252252
apiVersion: apps/v1
@@ -265,7 +265,7 @@ metadata:
265265
- database
266266
topologyKey: topology.kubernetes.io/zone
267267
matchLabelSelectors: # ADDED
268-
- matchLabelKeys: pod-template-hash
268+
- Key: pod-template-hash
269269
operator: In
270270
```
271271
@@ -281,13 +281,13 @@ affinity:
281281
podAffinity: # ensures the pods of this tenant land on the same node pool
282282
requiredDuringSchedulingIgnoredDuringExecution:
283283
- matchLabelSelectors:
284-
- matchLabelKey: tenant
284+
- Key: tenant
285285
operator: In
286286
topologyKey: node-pool
287287
podAntiAffinity: # ensures only Pods from this tenant lands on the same node pool
288288
requiredDuringSchedulingIgnoredDuringExecution:
289289
- matchLabelSelectors:
290-
- matchLabelKey: tenant
290+
- Key: tenant
291291
operator: NotIn
292292
- labelSelector:
293293
matchExpressions:
@@ -326,7 +326,7 @@ Consider including folks who also work outside the SIG or subproject.
326326
-->
327327

328328
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
330330
which pods should be grouped. If so, the user needs to ensure that it is
331331
correct and not duplicated with other unrelated workloads.
332332

@@ -345,11 +345,11 @@ A new optional field `MatchLabelSelectors` is introduced to `PodAffinityTerm`.
345345
type LabelSelectorOperator string
346346
347347
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,
349349
// and that key-value label is merged with `LabelSelector`.
350350
// 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.
353353
// If Operator is `In`, `key in (value)` is merged with LabelSelector.
354354
// If Operator is `NotIn`, `key notin (value)` is merged with LabelSelector.
355355
//
@@ -372,7 +372,7 @@ type PodAffinityTerm struct {
372372
```
373373

374374
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`.
376376

377377
The obtained labels will be merged to `LabelSelector` of `PodAffinityTerm` depending on `Operator`.
378378
- 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
961961
information to express the idea and why it was not acceptable.
962962
-->
963963

964+
###
965+
964966
## Infrastructure Needed (Optional)
965967

966968
<!--

0 commit comments

Comments
 (0)