Skip to content

Commit 5b716f5

Browse files
authored
Merge pull request #45359 from windsonsea/mulzone
[zh] Sync multiple-zones.md
2 parents 2804225 + 03138d1 commit 5b716f5

File tree

1 file changed

+54
-49
lines changed

1 file changed

+54
-49
lines changed

content/zh-cn/docs/setup/best-practices/multiple-zones.md

Lines changed: 54 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: 运行于多可用区环境
3-
weight: 10
3+
weight: 20
44
content_type: concept
55
---
66
<!--
@@ -9,7 +9,7 @@ reviewers:
99
- justinsb
1010
- quinton-hoole
1111
title: Running in multiple zones
12-
weight: 10
12+
weight: 20
1313
content_type: concept
1414
-->
1515

@@ -18,7 +18,7 @@ content_type: concept
1818
<!--
1919
This page describes running a cluster across multiple zones.
2020
-->
21-
本页描述如何跨多个区(Zone)中运行集群
21+
本页描述如何跨多个区(Zone)运行集群
2222

2323
<!-- body -->
2424

@@ -35,11 +35,11 @@ APIs and services.
3535
Typical cloud architectures aim to minimize the chance that a failure in
3636
one zone also impairs services in another zone.
3737
-->
38-
## 背景
38+
## 背景 {#background}
3939

4040
Kubernetes 从设计上允许同一个 Kubernetes 集群跨多个失效区来运行,
41-
通常这些区位于某个称作 _区域(region)_ 逻辑分组中。
42-
主要的云提供商都将区域定义为一组失效区的集合(也称作 _可用区(Availability Zones_),
41+
通常这些区位于某个称作 **区域(Region)** 逻辑分组中。
42+
主要的云提供商都将区域定义为一组失效区的集合(也称作 **可用区(Availability Zones**),
4343
能够提供一组一致的功能特性:每个区域内,各个可用区提供相同的 API 和服务。
4444

4545
典型的云体系结构都会尝试降低某个区中的失效影响到其他区中服务的概率。
@@ -66,10 +66,10 @@ If you are running a cloud controller manager then you should
6666
also replicate this across all the failure zones you selected.
6767
-->
6868
当你部署集群控制面时,应将控制面组件的副本跨多个失效区来部署。
69-
如果可用性是一个很重要的指标,应该选择至少三个失效区,并将每个
70-
控制面组件(API 服务器、调度器、etcd、控制器管理器)复制多个副本,
71-
跨至少三个失效区来部署。如果你在运行云控制器管理器,则也应该将
72-
该组件跨所选的三个失效区来部署
69+
如果可用性是一个很重要的指标,应该选择至少三个失效区,
70+
并将每个控制面组件(API 服务器、调度器、etcd、控制器管理器)复制多个副本,
71+
跨至少三个失效区来部署。如果你在运行云控制器管理器,
72+
则也应该将该组件跨所选的三个失效区来部署
7373

7474
{{< note >}}
7575
<!--
@@ -94,9 +94,9 @@ reduce the impact of failures.
9494
-->
9595
## 节点行为 {#node-behavior}
9696

97-
Kubernetes 自动为负载资源(如{{< glossary_tooltip text="Deployment" term_id="deployment" >}}
98-
或 {{< glossary_tooltip text="StatefulSet" term_id="statefulset" >}})
99-
跨集群中不同节点来部署其 Pods
97+
Kubernetes 自动为负载资源(如 {{< glossary_tooltip text="Deployment" term_id="deployment" >}}
98+
或 {{< glossary_tooltip text="StatefulSet" term_id="statefulset" >}})
99+
跨集群中不同节点来部署其 Pod
100100
这种分布逻辑有助于降低失效带来的影响。
101101

102102
<!--
@@ -106,8 +106,8 @@ that represents that specific kubelet in the Kubernetes API.
106106
These labels can include
107107
[zone information](/docs/reference/labels-annotations-taints/#topologykubernetesiozone).
108108
-->
109-
节点启动时,每个节点上的 kubelet 会向 Kubernetes API 中代表该 kubelet 的 Node 对象
110-
添加 {{< glossary_tooltip text="标签" term_id="label" >}}。
109+
节点启动时,每个节点上的 kubelet 会向 Kubernetes API 中代表该 kubelet 的 Node
110+
对象添加{{< glossary_tooltip text="标签" term_id="label" >}}。
111111
这些标签可能包含[区信息](/zh-cn/docs/reference/labels-annotations-taints/#topologykubernetesiozone)
112112

113113
<!--
@@ -123,11 +123,9 @@ failure affects your whole workload.
123123
-->
124124
如果你的集群跨了多个可用区或者地理区域,你可以使用节点标签,结合
125125
[Pod 拓扑分布约束](/zh-cn/docs/concepts/scheduling-eviction/topology-spread-constraints/)
126-
来控制如何在你的集群中多个失效域之间分布 Pods。这里的失效域可以是
127-
地理区域、可用区甚至是特定节点。
128-
这些提示信息使得{{< glossary_tooltip text="调度器" term_id="kube-scheduler" >}}
129-
能够更好地分布 Pods,以实现更好的可用性,降低因为某种失效给整个工作负载
130-
带来的风险。
126+
来控制如何在你的集群中多个失效域之间分布 Pod。这里的失效域可以是地理区域、可用区甚至是特定节点。
127+
这些提示信息使得{{< glossary_tooltip text="调度器" term_id="kube-scheduler" >}}能够更好地调度
128+
Pod,以实现更好的可用性,降低因为某种失效给整个工作负载带来的风险。
131129

132130
<!--
133131
For example, you can set a constraint to make sure that the
@@ -136,8 +134,8 @@ other, whenever that is feasible. You can define this declaratively
136134
without explicitly defining which availability zones are in use for
137135
each workload.
138136
-->
139-
例如,你可以设置一种约束,确保某个 StatefulSet 中的三个副本都运行在
140-
不同的可用区中,只要其他条件允许。你可以通过声明的方式来定义这种约束,
137+
例如,你可以设置一种约束,确保某个 StatefulSet 中的 3 个副本都运行在不同的可用区中,
138+
只要其他条件允许。你可以通过声明的方式来定义这种约束,
141139
而不需要显式指定每个工作负载使用哪些可用区。
142140

143141
<!--
@@ -151,18 +149,18 @@ Using tools such as the Cluster API you can define sets of machines to run as
151149
worker nodes for your cluster across multiple failure domains, and rules to
152150
automatically heal the cluster in case of whole-zone service disruption.
153151
-->
154-
### 跨多个区分布节点 {#distributing-nodes-across-zones}
152+
### 跨多个区分布节点 {#distributing-nodes-across-zones}
155153

156-
Kubernetes 的核心逻辑并不会帮你创建节点,你需要自行完成此操作,或者使用
157-
类似 [Cluster API](https://cluster-api.sigs.k8s.io/) 这类工具来替你管理节点。
154+
Kubernetes 的核心逻辑并不会帮你创建节点,你需要自行完成此操作,或者使用类似
155+
[Cluster API](https://cluster-api.sigs.k8s.io/) 这类工具来替你管理节点。
158156

159157
<!--
160158
Using tools such as the Cluster API you can define sets of machines to run as
161159
worker nodes for your cluster across multiple failure domains, and rules to
162160
automatically heal the cluster in case of whole-zone service disruption.
163161
-->
164-
使用类似 Cluster API 这类工具,你可以跨多个失效域来定义一组用做你的集群
165-
工作节点的机器,以及当整个区的服务出现中断时如何自动治愈集群的策略。
162+
使用类似 Cluster API 这类工具,你可以跨多个失效域来定义一组用做你的集群工作节点的机器,
163+
以及当整个区的服务出现中断时如何自动治愈集群的策略。
166164

167165
<!--
168166
## Manual zone assignment for Pods
@@ -171,16 +169,15 @@ You can apply [node selector constraints](/docs/concepts/scheduling-eviction/ass
171169
to Pods that you create, as well as to Pod templates in workload resources
172170
such as Deployment, StatefulSet, or Job.
173171
-->
174-
## Pods 手动指定区
172+
## Pod 手动指定区 {#manual-zone-assignment-for-pods}
175173

176174
<!--
177175
You can apply [node selector constraints](/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector)
178176
to Pods that you create, as well as to Pod templates in workload resources
179177
such as Deployment, StatefulSet, or Job.
180178
-->
181-
你可以应用[节点选择算符约束](/zh-cn/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector)
182-
到你所创建的 Pods 上,或者为 Deployment、StatefulSet 或 Job 这类工作负载资源
183-
中的 Pod 模板设置此类约束。
179+
你可以应用[节点选择算符约束](/zh-cn/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector)到你所创建的
180+
Pod 上,或者为 Deployment、StatefulSet 或 Job 这类工作负载资源中的 Pod 模板设置此类约束。
184181

185182
<!--
186183
## Storage access for zones
@@ -195,12 +192,20 @@ Please note that the method of adding zone labels can depend on your
195192
cloud provider and the storage provisioner you’re using. Always refer to the specific
196193
documentation for your environment to ensure correct configuration.
197194
-->
198-
## 跨区的存储访问
195+
## 跨区的存储访问 {#storage-access-for-zones}
199196

200-
当创建持久卷时,Kubernetes 会自动向那些链接到特定区的 PersistentVolume 添加区标签。
197+
当创建持久卷时,Kubernetes 会自动向那些链接到特定区的 PersistentVolume 添加区标签。
201198
{{< glossary_tooltip text="调度器" term_id="kube-scheduler" >}}通过其
202-
`NoVolumeZoneConflict` 断言确保申领给定 PersistentVolume 的 Pods 只会
203-
被调度到该卷所在的可用区。
199+
`NoVolumeZoneConflict` 断言确保申领给定 PersistentVolume 的 Pod
200+
只会被调度到该卷所在的可用区。
201+
202+
<!--
203+
Please note that the method of adding zone labels can depend on your
204+
cloud provider and the storage provisioner you’re using. Always refer to the specific
205+
documentation for your environment to ensure correct configuration.
206+
-->
207+
请注意,添加区标签的方法可能取决于你的云提供商和存储制备器。
208+
请参阅具体的环境文档,确保配置正确。
204209

205210
请注意,添加区标签的方法可能会根据你所使用的云提供商和存储制备器而有所不同。
206211
为确保配置正确,请始终参阅你的环境的特定文档。
@@ -212,10 +217,11 @@ storage in that class may use.
212217
To learn about configuring a StorageClass that is aware of failure domains or zones,
213218
see [Allowed topologies](/docs/concepts/storage/storage-classes/#allowed-topologies).
214219
-->
215-
你可以为 PersistentVolumeClaim 指定{{< glossary_tooltip text="StorageClass" term_id="storage-class" >}}
220+
你可以为 PersistentVolumeClaim 指定
221+
{{< glossary_tooltip text="StorageClass" term_id="storage-class" >}}
216222
以设置该类中的存储可以使用的失效域(区)。
217-
要了解如何配置能够感知失效域或区的 StorageClass,请参阅
218-
[可用的拓扑逻辑](/zh-cn/docs/concepts/storage/storage-classes/#allowed-topologies)
223+
要了解如何配置能够感知失效域或区的 StorageClass,
224+
请参阅[可用的拓扑逻辑](/zh-cn/docs/concepts/storage/storage-classes/#allowed-topologies)
219225

220226
<!--
221227
## Networking
@@ -228,13 +234,13 @@ elements. For example, if your cloud provider supports Services with
228234
same zone as the load balancer element processing a given connection.
229235
Check your cloud provider's documentation for details.
230236
-->
231-
## 网络 {#networking}
237+
## 网络 {#networking}
232238

233239
Kubernetes 自身不提供与可用区相关的联网配置。
234240
你可以使用[网络插件](/zh-cn/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/)
235241
来配置集群的联网,该网络解决方案可能拥有一些与可用区相关的元素。
236-
例如,如果你的云提供商支持 `type=LoadBalancer` 的 Service,则负载均衡器
237-
可能仅会将请求流量发送到运行在负责处理给定连接的负载均衡器组件所在的区
242+
例如,如果你的云提供商支持 `type=LoadBalancer` 的 Service,
243+
则负载均衡器可能仅会将请求流量发送到运行在负责处理给定连接的负载均衡器组件所在的区
238244
请查阅云提供商的文档了解详细信息。
239245

240246
<!--
@@ -243,8 +249,8 @@ For custom or on-premises deployments, similar considerations apply.
243249
{{< glossary_tooltip text="Ingress" term_id="ingress" >}} behavior, including handling
244250
of different failure zones, does vary depending on exactly how your cluster is set up.
245251
-->
246-
对于自定义的或本地集群部署,也可以考虑这些因素
247-
{{< glossary_tooltip text="Service" term_id="service" >}}
252+
对于自定义的或本地集群部署,也可以考虑这些因素
253+
{{< glossary_tooltip text="Service" term_id="service" >}}
248254
{{< glossary_tooltip text="Ingress" term_id="ingress" >}} 的行为,
249255
包括处理不同失效区的方法,在很大程度上取决于你的集群是如何搭建的。
250256

@@ -266,11 +272,11 @@ something to consider.
266272
-->
267273
## 失效恢复 {#fault-recovery}
268274

269-
在搭建集群时,你可能需要考虑当某区域中的所有失效区都同时掉线时,是否以及如何
270-
恢复服务。例如,你是否要求在某个区中至少有一个节点能够运行 Pod?
275+
在搭建集群时,你可能需要考虑当某区域中的所有失效区都同时掉线时,是否以及如何恢复服务。
276+
例如,你是否要求在某个区中至少有一个节点能够运行 Pod?
271277
请确保任何对集群很关键的修复工作都不要指望集群中至少有一个健康节点。
272278
例如:当所有节点都不健康时,你可能需要运行某个修复性的 Job,
273-
该 Job 要设置特定的{{< glossary_tooltip text="容忍度" term_id="toleration" >}}
279+
该 Job 要设置特定的{{< glossary_tooltip text="容忍度" term_id="toleration" >}}
274280
以便修复操作能够至少将一个节点恢复为可用状态。
275281

276282
Kubernetes 对这类问题没有现成的解决方案;不过这也是要考虑的因素之一。
@@ -281,6 +287,5 @@ Kubernetes 对这类问题没有现成的解决方案;不过这也是要考虑
281287
To learn how the scheduler places Pods in a cluster, honoring the configured constraints,
282288
visit [Scheduling and Eviction](/docs/concepts/scheduling-eviction/).
283289
-->
284-
要了解调度器如何在集群中放置 Pods 并遵从所配置的约束,可参阅
285-
[调度与驱逐](/zh-cn/docs/concepts/scheduling-eviction/)
286-
290+
要了解调度器如何在集群中放置 Pod 并遵从所配置的约束,
291+
可参阅[调度与驱逐](/zh-cn/docs/concepts/scheduling-eviction/)

0 commit comments

Comments
 (0)