Skip to content

Commit 73c3fc9

Browse files
authored
Merge pull request #26044 from tengqm/zh-resync-deployment
[zh] Resync concepts/workloads/controllers/deployment.md
2 parents 8d3dcf5 + d5a6266 commit 73c3fc9

File tree

1 file changed

+35
-18
lines changed

1 file changed

+35
-18
lines changed

content/zh/docs/concepts/workloads/controllers/deployment.md

Lines changed: 35 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ feature:
55
description: >
66
Kubernetes 会分步骤地将针对应用或其配置的更改上线,同时监视应用程序运行状况以确保你不会同时终止所有实例。如果出现问题,Kubernetes 会为你回滚所作更改。你应该充分利用不断成长的部署方案生态系统。
77
content_type: concept
8-
weight: 30
8+
weight: 10
99
---
1010
<!--
1111
title: Deployments
@@ -15,24 +15,24 @@ feature:
1515
Kubernetes progressively rolls out changes to your application or its configuration, while monitoring application health to ensure it doesn't kill all your instances at the same time. If something goes wrong, Kubernetes will rollback the change for you. Take advantage of a growing ecosystem of deployment solutions.
1616
1717
content_type: concept
18-
weight: 30
18+
weight: 10
1919
-->
2020

2121
<!-- overview -->
2222

2323
<!--
24-
A _Deployment_ controller provides declarative updates for [Pods](/docs/concepts/workloads/pods/pod/) and
24+
A _Deployment_ provides declarative updates for [Pods](/docs/concepts/workloads/pods/pod/) and
2525
[ReplicaSets](/docs/concepts/workloads/controllers/replicaset/).
2626
-->
27-
一个 _Deployment_ 控制器为 {{< glossary_tooltip text="Pods" term_id="pod" >}}
27+
一个 _Deployment_ {{< glossary_tooltip text="Pods" term_id="pod" >}}
2828
和 {{< glossary_tooltip term_id="replica-set" text="ReplicaSets" >}}
2929
提供声明式的更新能力。
3030

3131
<!--
32-
You describe a _desired state_ in a Deployment, and the Deployment controller changes the actual state to the desired state at a controlled rate. You can define Deployments to create new ReplicaSets, or to remove existing Deployments and adopt all their resources with new Deployments.
33-
32+
You describe a _desired state_ in a Deployment, and the Deployment {{< glossary_tooltip term_id="controller" >}} changes the actual state to the desired state at a controlled rate. You can define Deployments to create new ReplicaSets, or to remove existing Deployments and adopt all their resources with new Deployments.
3433
-->
35-
你负责描述 Deployment 中的 _目标状态_,而 Deployment 控制器以受控速率更改实际状态,
34+
你负责描述 Deployment 中的 _目标状态_,而 Deployment {{< glossary_tooltip term_id="controller" >}}
35+
以受控速率更改实际状态,
3636
使其变为期望状态。你可以定义 Deployment 以创建新的 ReplicaSet,或删除现有 Deployment,
3737
并通过新的 Deployment 收养其资源。
3838

@@ -196,9 +196,12 @@ Follow the steps given below to create the above Deployment:
196196
请注意期望副本数是根据 `.spec.replicas` 字段设置 3。
197197

198198
<!--
199-
3. To see the Deployment rollout status, run `kubectl rollout status deployment.v1.apps/nginx-deployment`. The output is similar to this:
199+
3. To see the Deployment rollout status, run `kubectl rollout status deployment/nginx-deployment`.
200+
201+
The output is similar to:
200202
-->
201-
3. 要查看 Deployment 上线状态,运行 `kubectl rollout status deployment.v1.apps/nginx-deployment`
203+
3. 要查看 Deployment 上线状态,运行 `kubectl rollout status deployment/nginx-deployment`
204+
202205
输出类似于:
203206

204207
```
@@ -341,9 +344,11 @@ is changed, for example if the labels or container images of the template are up
341344

342345
```shell
343346
kubectl --record deployment.apps/nginx-deployment set image \
344-
deployment.v1.apps/nginx-deployment nginx=nginx:1.9.1
347+
deployment.v1.apps/nginx-deployment nginx=nginx:1.16.1
345348
```
346-
<!-- or simply use the following command: -->
349+
<!--
350+
or simply use the following command:
351+
-->
347352
或者使用下面的命令:
348353

349354
```shell
@@ -380,7 +385,7 @@ is changed, for example if the labels or container images of the template are up
380385
2. 要查看上线状态,运行:
381386

382387
```shell
383-
kubectl rollout status deployment.v1.apps/nginx-deployment
388+
kubectl rollout status deployment/nginx-deployment
384389
```
385390

386391
<!-- The output is similar to this: -->
@@ -655,9 +660,10 @@ Deployment 被触发上线时,系统就会创建 Deployment 的新的修订版
655660
{{< /note >}}
656661

657662
<!--
658-
* Suppose that you made a typo while updating the Deployment, by putting the image name as `nginx:1.91` instead of `nginx:1.9.1`:
663+
* Suppose that you made a typo while updating the Deployment, by putting the image name as `nginx:1.161` instead of `nginx:1.16.1`:
659664
-->
660-
* 假设你在更新 Deployment 时犯了一个拼写错误,将镜像名称命名设置为 `nginx:1.161` 而不是 `nginx:1.16.1`
665+
* 假设你在更新 Deployment 时犯了一个拼写错误,将镜像名称命名设置为
666+
`nginx:1.161` 而不是 `nginx:1.16.1`
661667

662668
```shell
663669
kubectl set image deployment.v1.apps/nginx-deployment nginx=nginx:1.161 --record=true
@@ -676,7 +682,7 @@ Deployment 被触发上线时,系统就会创建 Deployment 的新的修订版
676682
* 此上线进程会出现停滞。你可以通过检查上线状态来验证:
677683

678684
```shell
679-
kubectl rollout status deployment.v1.apps/nginx-deployment
685+
kubectl rollout status deployment/nginx-deployment
680686
```
681687

682688
<!-- The output is similar to this: -->
@@ -1431,7 +1437,7 @@ successfully, `kubectl rollout status` returns a zero exit code.
14311437
如果上线成功完成,`kubectl rollout status` 返回退出代码 0。
14321438

14331439
```shell
1434-
kubectl rollout status deployment.v1.apps/nginx-deployment
1440+
kubectl rollout status deployment/nginx-deployment
14351441
```
14361442

14371443
<!-- The output is similar to this: -->
@@ -1652,16 +1658,27 @@ returns a non-zero exit code if the Deployment has exceeded the progression dead
16521658
如果 Deployment 已超过进度限期,`kubectl rollout status` 返回非零退出代码。
16531659

16541660
```shell
1655-
kubectl rollout status deployment.v1.apps/nginx-deployment
1661+
kubectl rollout status deployment/nginx-deployment
16561662
```
16571663

1658-
<!-- The output is similar to this: -->
1664+
<!--
1665+
The output is similar to this:
1666+
-->
16591667
输出类似于:
16601668

16611669
```
16621670
Waiting for rollout to finish: 2 out of 3 new replicas have been updated...
16631671
error: deployment "nginx" exceeded its progress deadline
1672+
```
1673+
<!--
1674+
and the exit status from `kubectl rollout` is 1 (indicating an error):
1675+
-->
1676+
`kubectl rollout` 命令的退出状态为 1(表明发生了错误):
1677+
1678+
```shell
16641679
$ echo $?
1680+
```
1681+
```
16651682
1
16661683
```
16671684

0 commit comments

Comments
 (0)