Skip to content

Commit 026bc66

Browse files
committed
[zh-cn]sync scale-intro update-intro
Signed-off-by: xin.li <[email protected]>
1 parent be026b5 commit 026bc66

File tree

2 files changed

+47
-54
lines changed

2 files changed

+47
-54
lines changed

content/zh-cn/docs/tutorials/kubernetes-basics/scale/scale-intro.md

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ first delete that Service and then run the following command to create a new Ser
6262
with its `type` set to `LoadBalancer`:
6363
-->
6464
如果你是在[上一节](/zh-cn/docs/tutorials/kubernetes-basics/expose/expose-intro/)之后尝试此操作,
65-
那么你可能已经删除了你创建的服务或已创建了 `type: NodePort` 类别的 Service。
65+
那么你可能已经删除了创建的 Service 或已创建了 `type: NodePort` 类型的 Service。
6666
在本节中,假设你已经为 kubernetes-bootcamp Deployment 创建了 `type: LoadBalancer`
67-
类别的 Service。
67+
类型的 Service。
6868

6969
如果你**没有**删除在[前一节](/zh-cn/docs/tutorials/kubernetes-basics/expose/expose-intro)中创建的 Service,
7070
请先删除该 Service,然后运行以下命令来创建一个新的 `type` 设置为 `LoadBalancer` 的 Service:
@@ -79,19 +79,14 @@ kubectl expose deployment/kubernetes-bootcamp --type="LoadBalancer" --port 8080
7979
-->
8080
## 扩缩概述
8181

82-
<!-- animation -->
83-
<div class="col-md-8">
84-
<div id="myCarousel" class="carousel" data-ride="carousel" data-interval="3000">
85-
<div class="carousel-inner" role="listbox">
86-
<div class="item carousel-item active">
87-
<img src="/docs/tutorials/kubernetes-basics/public/images/module_05_scaling1.svg">
88-
</div>
89-
<div class="item carousel-item">
90-
<img src="/docs/tutorials/kubernetes-basics/public/images/module_05_scaling2.svg">
91-
</div>
92-
</div>
93-
</div>
94-
</div>
82+
{{< tutorials/carousel id="myCarousel" interval="3000" >}}
83+
{{< tutorials/carousel-item
84+
image="/docs/tutorials/kubernetes-basics/public/images/module_05_scaling1.svg"
85+
active="true" >}}
86+
87+
{{< tutorials/carousel-item
88+
image="/docs/tutorials/kubernetes-basics/public/images/module_05_scaling2.svg" >}}
89+
{{< /tutorials/carousel >}}
9590

9691
{{% alert %}}
9792
<!--
@@ -111,7 +106,7 @@ possible, and it will terminate all Pods of the specified Deployment.
111106
扩容会将 Pod 数量增加至新的预期状态。
112107
Kubernetes 还支持 Pod 的[自动扩缩容](/zh-cn/docs/tasks/run-application/horizontal-pod-autoscale/)
113108
但这并不在本教程的讨论范围内。
114-
Pods 数量收缩到 0 也是可以的,这会终止指定 Deployment 上所有的 Pod。
109+
Pod 数量收缩到 0 也是可以的,这会终止指定 Deployment 上所有的 Pod。
115110

116111
<!--
117112
Running multiple instances of an application will require a way to distribute the
@@ -182,22 +177,22 @@ Notice that the name of the ReplicaSet is always formatted as
182177
The random string is randomly generated and uses the pod-template-hash as a seed.
183178
184179
Two important columns of this output are:
180+
-->
181+
注意 ReplicaSet 名称总是遵循 <nobr>[DEPLOYMENT-NAME]-[RANDOM-STRING]</nobr> 的格式。
182+
随机字符串是使用 `pod-template-hash` 作为种子随机生成的。
185183

184+
两个重要的列是:
185+
<!--
186186
* _DESIRED_ displays the desired number of replicas of the application, which you
187187
define when you create the Deployment. This is the desired state.
188188
* _CURRENT_ displays how many replicas are currently running.
189189
Next, let’s scale the Deployment to 4 replicas. We’ll use the `kubectl scale` command,
190190
followed by the Deployment type, name and desired number of instances:
191191
-->
192-
注意 ReplicaSet 名称总是遵循 <nobr>[DEPLOYMENT-NAME]-[RANDOM-STRING]</nobr> 的格式。
193-
随机字符串是使用 `pod-template-hash` 作为种子随机生成的。
194-
195-
两个重要的列是:
196-
197192
* **DESIRED** 显示期望应用具有的副本数量,在你创建 Deployment 时要定义这个值。这是期望的状态。
198193
* **CURRENT** 显示当前正在运行的副本数量。
199194

200-
接下来,让我们扩容 Deployment 4 个副本。
195+
接下来,让我们将 Deployment 扩容到 4 个副本。
201196
我们将使用 `kubectl scale` 命令,后面给出 Deployment 类别、名称和预期的实例数量:
202197

203198
```shell
@@ -341,7 +336,7 @@ kubectl scale deployments/kubernetes-bootcamp --replicas=2
341336
<!--
342337
List the Deployments to check if the change was applied with the `get deployments` subcommand:
343338
-->
344-
要检查更改是否已应用,可使用 `get deployments` 子命令
339+
要检查更改是否已应用,可使用 `get deployments` 子命令
345340

346341
```shell
347342
kubectl get deployments
@@ -370,5 +365,5 @@ This confirms that 2 Pods were terminated.
370365
* Learn more about [Autoscaling](/docs/concepts/workloads/autoscaling/).
371366
-->
372367
* [滚动更新](/zh-cn/docs/tutorials/kubernetes-basics/update/update-intro/)教程。
373-
* 了解更多关于[ReplicaSet](/zh-cn/docs/concepts/workloads/controllers/replicaset/)
368+
* 了解更多关于 [ReplicaSet](/zh-cn/docs/concepts/workloads/controllers/replicaset/)
374369
* 了解更多关于[自动伸缩](/zh-cn/docs/concepts/workloads/autoscaling/)

content/zh-cn/docs/tutorials/kubernetes-basics/update/update-intro.md

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ The new Pods are scheduled on Nodes with available resources, and Kubernetes wai
3737
for those new Pods to start before removing the old Pods.
3838
-->
3939
用户希望应用程序始终可用,而开发人员则需要每天多次部署它们的新版本。
40-
在 Kubernetes 中,这些是通过滚动更新(Rolling Updates)完成的。
40+
在 Kubernetes 中,这些是通过滚动更新(Rolling Update)完成的。
4141
**滚动更新**允许通过使用新的实例逐步更新 Pod 实例,实现零停机的 Deployment 更新。
4242
新的 Pod 将被调度到具有可用资源的节点上。
4343

@@ -54,27 +54,25 @@ versioned and any Deployment update can be reverted to a previous (stable) versi
5454
这两个选项都可以配置为(Pod)数字或百分比。
5555
在 Kubernetes 中,更新是具有版本控制的,任何 Deployment 更新都可以恢复到以前的(稳定)版本。
5656

57+
<!--
5758
## Rolling updates overview
59+
-->
60+
## 滚动更新概述
61+
62+
{{< tutorials/carousel id="myCarousel" interval="3000" >}}
63+
{{< tutorials/carousel-item
64+
image="/docs/tutorials/kubernetes-basics/public/images/module_06_rollingupdates1.svg"
65+
active="true" >}}
66+
67+
{{< tutorials/carousel-item
68+
image="/docs/tutorials/kubernetes-basics/public/images/module_06_rollingupdates2.svg" >}}
5869

59-
<!-- animation -->
60-
<div class="col-md-8">
61-
<div id="myCarousel" class="carousel" data-ride="carousel" data-interval="3000">
62-
<div class="carousel-inner" role="listbox">
63-
<div class="item carousel-item active">
64-
<img src="/docs/tutorials/kubernetes-basics/public/images/module_06_rollingupdates1.svg">
65-
</div>
66-
<div class="item carousel-item">
67-
<img src="/docs/tutorials/kubernetes-basics/public/images/module_06_rollingupdates2.svg">
68-
</div>
69-
<div class="item carousel-item">
70-
<img src="/docs/tutorials/kubernetes-basics/public/images/module_06_rollingupdates3.svg">
71-
</div>
72-
<div class="item carousel-item">
73-
<img src="/docs/tutorials/kubernetes-basics/public/images/module_06_rollingupdates4.svg">
74-
</div>
75-
</div>
76-
</div>
77-
</div>
70+
{{< tutorials/carousel-item
71+
image="/docs/tutorials/kubernetes-basics/public/images/module_06_rollingupdates3.svg" >}}
72+
73+
{{< tutorials/carousel-item
74+
image="/docs/tutorials/kubernetes-basics/public/images/module_06_rollingupdates4.svg" >}}
75+
{{< /tutorials/carousel >}}
7876

7977
{{% alert %}}
8078
<!--
@@ -91,19 +89,20 @@ will load-balance the traffic only to available Pods during the update. An avail
9189
Pod is an instance that is available to the users of the application.
9290
9391
Rolling updates allow the following actions:
92+
-->
93+
与应用程序规模扩缩类似,如果 Deployment 的访问是公开的,Service
94+
在更新期间仅将流量负载均衡到可用的 Pod。可用的 Pod 是指对应用的用户可用的实例。
9495

96+
滚动更新允许以下操作:
97+
98+
<!--
9599
* Promote an application from one environment to another (via container image updates)
96100
* Rollback to previous versions
97101
* Continuous Integration and Continuous Delivery of applications with zero downtime
98102
99103
In the following interactive tutorial, we'll update our application to a new version,
100104
and also perform a rollback.
101105
-->
102-
与应用程序规模扩缩类似,如果 Deployment 的访问是公开的,Service
103-
在更新期间仅将流量负载均衡到可用的 Pod。可用的 Pod 是指对应用的用户可用的实例。
104-
105-
滚动更新允许以下操作:
106-
107106
* 将应用程序从一个环境升级到另一个环境(通过容器镜像更新)
108107
* 回滚到以前的版本
109108
* 持续集成和持续交付应用程序,无需停机
@@ -175,8 +174,8 @@ you can create it again with:
175174
-->
176175
### 验证更新
177176

178-
首先,检查服务是否正在运行,因为你可能在上一个教程步骤中删除了它。
179-
运行 `describe services/kubernetes-bootcamp`如果服务缺失
177+
首先,检查 Service 是否正在运行,因为你可能在上一个教程步骤中删除了它。
178+
运行 `describe services/kubernetes-bootcamp`如果 Service 缺失
180179
你可以使用以下命令重新创建:
181180

182181
```shell
@@ -259,8 +258,7 @@ kubectl get deployments
259258
Notice that the output doesn't list the desired number of available Pods. Run the
260259
`get pods` subcommand to list all Pods:
261260
-->
262-
注意输出中不会列出期望的可用 Pod 数。运行 `get pods`
263-
子命令来列出所有 Pod:
261+
注意输出中不会列出期望的可用 Pod 数。运行 `get pods` 子命令来列出所有 Pod:
264262

265263
```shell
266264
kubectl get pods
@@ -304,7 +302,7 @@ Use the `get pods` subcommand to list the Pods again:
304302
`rollout undo` 命令会恢复 Deployment 到先前的已知状态(`v2` 的镜像)。
305303
更新是有版本控制的,你可以恢复 Deployment 到任何先前已知状态。
306304

307-
使用 `get pods` 子命令再次列举 Pod:
305+
使用 `get pods` 子命令再次列出 Pod:
308306

309307
```shell
310308
kubectl get pods

0 commit comments

Comments
 (0)