[zh-cn] sync deployment.md

Signed-off-by: Gao Qian <gaoq.jy@fujitsu.com>
pull/38637/head
Gao Qian 2022-12-26 20:59:11 -05:00
parent 2efbad02cb
commit 4cd25a0067
1 changed files with 30 additions and 17 deletions

View File

@ -96,20 +96,21 @@ In this example:
在该例中: 在该例中:
<!-- <!--
* A Deployment named `nginx-deployment` is created, indicated by the `.metadata.name` field. * A Deployment named `nginx-deployment` is created, indicated by the
* The Deployment creates three replicated Pods, indicated by the `.spec.replicas` field. `.metadata.name` field. This name will become the basis for the ReplicaSets
and Pods which are created later. See [Writing a Deployment Spec](#writing-a-deployment-spec)
--> for more details.
* 创建名为 `nginx-deployment`(由 `.metadata.name` 字段标明)的 Deployment。 * The Deployment creates a ReplicaSet that creates three replicated Pods, indicated by the `.spec.replicas` field.
* 该 Deployment 创建三个(由 `.spec.replicas` 字段标明Pod 副本。 * The `.spec.selector` field defines how the created ReplicaSet finds which Pods to manage.
<!--
* The `selector` field defines how the Deployment finds which Pods to manage.
In this case, you 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, However, more sophisticated selection rules are possible,
as long as the Pod template itself satisfies the rule. as long as the Pod template itself satisfies the rule.
--> -->
* `selector` 字段定义 Deployment 如何查找要管理的 Pod。 * 创建名为 `nginx-deployment`(由 `.metadata.name` 字段标明)的 Deployment。
该名称将成为后续创建 ReplicaSet 和 Pod 的命名基础。
参阅[编写 Deployment 规约](#writing-a-deployment-spec)获取更多详细信息。
* 该 Deployment 创建一个 ReplicaSet它创建三个`.spec.replicas` 字段标明Pod 副本。
* `.spec.selector` 字段定义所创建的 ReplicaSet 如何查找要管理的 Pod。
在这里,你选择在 Pod 模板中定义的标签(`app: nginx`)。 在这里,你选择在 Pod 模板中定义的标签(`app: nginx`)。
不过,更复杂的选择规则是也可能的,只要 Pod 模板本身满足所给规则即可。 不过,更复杂的选择规则是也可能的,只要 Pod 模板本身满足所给规则即可。
@ -253,10 +254,13 @@ Follow the steps given below to create the above Deployment:
* `AGE` 显示应用已经运行的时间长度。 * `AGE` 显示应用已经运行的时间长度。
<!-- <!--
Notice that the name of the ReplicaSet is always formatted as `[DEPLOYMENT-NAME]-[HASH]`. Notice that the name of the ReplicaSet is always formatted as
`[DEPLOYMENT-NAME]-[HASH]`. This name will become the basis for the Pods
which are created.
The `HASH` string is the same as the `pod-template-hash` label on the ReplicaSet. The `HASH` string is the same as the `pod-template-hash` label on the ReplicaSet.
--> -->
注意 ReplicaSet 的名称始终被格式化为`[Deployment名称]-[哈希]`。 注意 ReplicaSet 的名称格式始终为 `[Deployment 名称]-[哈希]`
该名称将成为所创建的 Pod 的命名基础。
其中的`哈希`字符串与 ReplicaSet 上的 `pod-template-hash` 标签一致。 其中的`哈希`字符串与 ReplicaSet 上的 `pod-template-hash` 标签一致。
<!-- <!--
@ -1894,14 +1898,23 @@ configuring containers, and [using kubectl to manage resources](/docs/concepts/o
配置容器和[使用 kubectl 管理资源](/zh-cn/docs/concepts/overview/working-with-objects/object-management/)等相关文档。 配置容器和[使用 kubectl 管理资源](/zh-cn/docs/concepts/overview/working-with-objects/object-management/)等相关文档。
<!-- <!--
The name of a Deployment object must be a valid When the control plane creates new Pods for a Deployment, the `.metadata.name` of the
[DNS subdomain name](/docs/concepts/overview/working-with-objects/names#dns-subdomain-names). Deployment is part of the basis for naming those Pods. The name of a Deployment must be a valid
[DNS subdomain](/docs/concepts/overview/working-with-objects/names#dns-subdomain-names)
value, but this can produce unexpected results for the Pod hostnames. For best compatibility,
the name should follow the more restrictive rules for a
[DNS label](/docs/concepts/overview/working-with-objects/names#dns-label-names).
A Deployment also needs a [`.spec` section](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status). A Deployment also needs a [`.spec` section](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status).
--> -->
Deployment 对象的名称必须是合法的 当控制面为 Deployment 创建新的 Pod 时Deployment 的 `.metadata.name` 是命名这些 Pod 的部分基础。
[DNS 子域名](/zh-cn/docs/concepts/overview/working-with-objects/names#dns-subdomain-names)。 Deployment 的名称必须是一个合法的
Deployment 还需要 [`.spec` 部分](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status)。 [DNS 子域](/zh-cn/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names)值,
但这会对 Pod 的主机名产生意外的结果。为获得最佳兼容性,名称应遵循更严格的
[DNS 标签](/zh-cn/docs/concepts/overview/working-with-objects/names#dns-label-names)规则。
Deployment 还需要
[`.spec` 部分](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status)。
<!-- <!--
### Pod Template ### Pod Template