[zh] Sync changes to workload controllers

This commit is contained in:
Qiming Teng
2021-03-29 20:43:52 +08:00
parent d830ee0f5b
commit 29d6c1135d
6 changed files with 42 additions and 30 deletions
@@ -102,24 +102,25 @@ In this example:
<!--
* The `selector` field defines how the Deployment finds which Pods to manage.
In this case, you simply select a label that is defined in the Pod template (`app: nginx`).
In this case, you select a label that is defined in the Pod template (`app: nginx`).
However, more sophisticated selection rules are possible,
as long as the Pod template itself satisfies the rule.
-->
* `selector` 字段定义 Deployment 如何查找要管理的 Pods。
在这里,你只需选择在 Pod 模板中定义的标签(`app: nginx`)。
在这里,你选择在 Pod 模板中定义的标签(`app: nginx`)。
不过,更复杂的选择规则是也可能的,只要 Pod 模板本身满足所给规则即可。
{{< note >}}
<!--
The `matchLabels` field is a map of {key,value} pairs. A single {key,value} in the `matchLabels` map
is equivalent to an element of `matchExpressions`, whose key field is "key" the operator is "In",
and the values array contains only "value".
The `spec.selector.matchLabels` field is a map of {key,value} pairs.
A single {key,value} in the `matchLabels` map is equivalent to an element of `matchExpressions`,
whose `key` field is "key", the `operator` is "In", and the `values` array contains only "value".
All of the requirements, from both `matchLabels` and `matchExpressions`, must be satisfied in order to match.
-->
{{< note >}}
`matchLabels` 字段是 `{key,value}` 偶对的映射。在 `matchLabels` 映射中的单个 `{key,value}`
映射等效于 `matchExpressions` 中的一个元素,即其 `key` 字段是 “key”,operator 为 “In”,`value`
数组仅包含 “value”。`matchLabels``matchExpressions` 中给出的所有条件都必须满足才能匹配。
`spec.selector.matchLabels` 字段是 `{key,value}` 键值对映射。
`matchLabels` 映射中的每个 `{key,value}` 映射等效于 `matchExpressions` 中的一个元素,
即其 `key` 字段是 “key”,`operator` 为 “In”,`values` 数组仅包含 “value”。
`matchLabels``matchExpressions` 中给出的所有条件都必须满足才能匹配。
{{< /note >}}
<!--
@@ -347,7 +348,7 @@ is changed, for example if the labels or container images of the template are up
deployment.v1.apps/nginx-deployment nginx=nginx:1.16.1
```
<!--
or simply use the following command:
or use the following command:
-->
或者使用下面的命令:
@@ -355,7 +356,7 @@ is changed, for example if the labels or container images of the template are up
kubectl set image deployment/nginx-deployment nginx=nginx:1.16.1 --record
```
<!-- The output is similar to this: -->
<!-- The output is similar to: -->
输出类似于:
```
@@ -429,7 +430,7 @@ up to 3 replicas, as well as scaling down the old ReplicaSet to 0 replicas.
kubectl get rs
```
<!-- The output is similar to this: -->
<!-- The output is similar to: -->
输出类似于:
```
@@ -1179,7 +1180,7 @@ apply multiple fixes in between pausing and resuming without triggering unnecess
这样做使得你能够在暂停和恢复执行之间应用多个修补程序,而不会触发不必要的上线操作。
<!--
* For example, with a Deployment that was just created:
* For example, with a Deployment that was created:
Get the Deployment details:
-->
* 例如,对于一个刚刚创建的 Deployment