Skip to content

Commit 78a1eb4

Browse files
authored
Merge pull request #50164 from mochizuki875/revert-49607-add_deprecation_matchlabelkeys_podtopologyspread
Revert "Update the description of TopologySpreadConstraints's matchLabelKeys to align with the design change"
2 parents 09234f3 + 9120e0c commit 78a1eb4

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

content/en/docs/concepts/scheduling-eviction/topology-spread-constraints.md

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -131,24 +131,18 @@ your cluster. Those fields are:
131131
See [Label Selectors](/docs/concepts/overview/working-with-objects/labels/#label-selectors)
132132
for more details.
133133

134-
- **matchLabelKeys** is a list of pod label keys to select the group of pods over which
135-
the spreading skew will be calculated. At a pod creation,
136-
the kube-apiserver uses those keys to lookup values from the incoming pod labels,
137-
and those key-value labels will be merged with any existing `labelSelector`.
138-
The same key is forbidden to exist in both `matchLabelKeys` and `labelSelector`.
139-
`matchLabelKeys` cannot be set when `labelSelector` isn't set.
140-
Keys that don't exist in the pod labels will be ignored.
141-
A null or empty list means only match against the `labelSelector`.
142-
143-
{{< caution >}}
144-
It's not recommended to use `matchLabelKeys` with labels that might be updated directly on pods.
145-
Even if you edit the pod's label that is specified at `matchLabelKeys` **directly**, (that is, not via a deployment),
146-
kube-apiserver doesn't reflect the label update onto the merged `labelSelector`.
147-
{{< /caution >}}
134+
- **matchLabelKeys** is a list of pod label keys to select the pods over which
135+
spreading will be calculated. The keys are used to lookup values from the pod labels,
136+
those key-value labels are ANDed with `labelSelector` to select the group of existing
137+
pods over which spreading will be calculated for the incoming pod. The same key is
138+
forbidden to exist in both `matchLabelKeys` and `labelSelector`. `matchLabelKeys` cannot
139+
be set when `labelSelector` isn't set. Keys that don't exist in the pod labels will be
140+
ignored. A null or empty list means only match against the `labelSelector`.
148141

149142
With `matchLabelKeys`, you don't need to update the `pod.spec` between different revisions.
150143
The controller/operator just needs to set different values to the same label key for different
151-
revisions. For example, if you are configuring a Deployment, you can use the label keyed with
144+
revisions. The scheduler will assume the values automatically based on `matchLabelKeys`. For
145+
example, if you are configuring a Deployment, you can use the label keyed with
152146
[pod-template-hash](/docs/concepts/workloads/controllers/deployment/#pod-template-hash-label), which
153147
is added automatically by the Deployment controller, to distinguish between different revisions
154148
in a single Deployment.

0 commit comments

Comments
 (0)