@@ -66,8 +66,8 @@ Kubernetes 集群的 IPv4/IPv6 双协议栈可提供下面的功能:
66
66
* IPv4 and IPv6 enabled Services
67
67
* Pod off-cluster egress routing (eg. the Internet) via both IPv4 and IPv6 interfaces
68
68
-->
69
- * 双协议栈 pod 网络 ( 每个 pod 分配一个 IPv4 和 IPv6 地址)
70
- * IPv4 和 IPv6 启用的服务
69
+ * 双协议栈 Pod 网络( 每个 Pod 分配一个 IPv4 和 IPv6 地址)
70
+ * IPv4 和 IPv6 启用的 Service
71
71
* Pod 的集群外出口通过 IPv4 和 IPv6 路由
72
72
73
73
<!--
@@ -90,11 +90,11 @@ The following prerequisites are needed in order to utilize IPv4/IPv6 dual-stack
90
90
* A [network plugin](/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/) that
91
91
supports dual-stack networking.
92
92
-->
93
- * Kubernetes 1.20 版本或更高版本,有关更早 Kubernetes 版本的使用双栈服务的信息 ,
93
+ * Kubernetes 1.20 版本或更高版本,有关更早 Kubernetes 版本的使用双栈 Service 的信息 ,
94
94
请参考对应版本的 Kubernetes 文档。
95
95
* 提供商支持双协议栈网络(云提供商或其他提供商必须能够为 Kubernetes
96
- 节点提供可路由的 IPv4/IPv6 网络接口)
97
- * 支持双协议栈的[ 网络插件] ( /zh-cn/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/ )
96
+ 节点提供可路由的 IPv4/IPv6 网络接口)。
97
+ * 支持双协议栈的[ 网络插件] ( /zh-cn/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/ ) 。
98
98
99
99
<!--
100
100
## Configure IPv4/IPv6 dual-stack
@@ -105,6 +105,7 @@ The following prerequisites are needed in order to utilize IPv4/IPv6 dual-stack
105
105
To configure IPv4/IPv6 dual-stack, set dual-stack cluster network assignments:
106
106
-->
107
107
如果配置 IPv4/IPv6 双栈,请分配双栈集群网络:
108
+
108
109
<!--
109
110
* kube-apiserver:
110
111
* `--service-cluster-ip-range=<IPv4 CIDR>,<IPv6 CIDR>`
@@ -115,27 +116,27 @@ To configure IPv4/IPv6 dual-stack, set dual-stack cluster network assignments:
115
116
* kube-proxy:
116
117
* `--cluster-cidr=<IPv4 CIDR>,<IPv6 CIDR>`
117
118
* kubelet:
118
- * when there is no `--cloud-provider` the administrator can pass a comma-separated pair of IP
119
- addresses via `--node-ip` to manually configure dual-stack `.status.addresses` for that Node.
120
- If a Pod runs on that node in HostNetwork mode, the Pod reports these IP addresses in its
121
- `.status.podIPs` field.
122
- All `podIPs` in a node match the IP family preference defined by the `.status.addresses`
123
- field for that Node.
124
- -->
125
- * kube-apiserver:
119
+ * `--node-ip=<IPv4 IP>,<IPv6 IP>`
120
+ * This option is required for bare metal dual-stack nodes (nodes that do not define a
121
+ cloud provider with the `--cloud-provider` flag). If you are using a cloud provider
122
+ and choose to override the node IPs chosen by the cloud provider, set the
123
+ `-- node-ip` option.
124
+ * (The legacy built-in cloud providers do not support dual-stack `--node-ip`.)
125
+ -->
126
+ * kube-apiserver:
126
127
* ` --service-cluster-ip-range=<IPv4 CIDR>,<IPv6 CIDR> `
127
- * kube-controller-manager:
128
+ * kube-controller-manager:
128
129
* ` --cluster-cidr=<IPv4 CIDR>,<IPv6 CIDR> `
129
130
* ` --service-cluster-ip-range=<IPv4 CIDR>,<IPv6 CIDR> `
130
131
* ` --node-cidr-mask-size-ipv4|--node-cidr-mask-size-ipv6 ` 对于 IPv4 默认为 /24,
131
132
对于 IPv6 默认为 /64
132
- * kube-proxy:
133
+ * kube-proxy:
133
134
* ` --cluster-cidr=<IPv4 CIDR>,<IPv6 CIDR> `
134
- * kubelet:
135
- * 当没有 ` --cloud-provider ` 时,管理员可以通过 ` -- node-ip` 来传递逗号分隔的 IP 地址,
136
- 为该节点手动配置双栈 ` .status.addresses ` 。
137
- 如果 Pod 以 HostNetwork 模式在该节点上运行,则 Pod 会用 ` .status.podIPs ` 字段来报告它的 IP 地址 。
138
- 一个节点中的所有 ` podIP ` 都会匹配该节点的由 ` .status.addresses ` 字段定义的 IP 组。
135
+ * kubelet:
136
+ * ` --node-ip=<IPv4 IP>,<IPv6 IP> `
137
+ * 裸机双栈节点(未使用 ` --cloud-provider ` 标志定义云平台的节点)需要此选项 。
138
+ 如果你使用了某个云平台并选择覆盖云平台所选择的节点 IP,请设置 ` --node-ip ` 选项 。
139
+ * (传统的内置云平台实现不支持双栈 ` --node-ip ` 。)
139
140
140
141
{{< note >}}
141
142
<!--
@@ -152,20 +153,10 @@ IPv6 CIDR 的一个例子:`fdXY:IJKL:MNOP:15::/64`
152
153
153
154
{{< feature-state for_k8s_version="v1.27" state="alpha" >}}
154
155
155
- <!--
156
- When using an external cloud provider, you can pass a dual-stack `--node-ip` value to
157
- kubelet if you enable the `CloudDualStackNodeIPs` feature gate in both kubelet and the
158
- external cloud provider. This is only supported for cloud providers that support dual
159
- stack clusters.
160
- -->
161
- 使用外部云驱动时,如果你在 kubelet 和外部云提供商中都启用了
162
- ` CloudDualStackNodeIPs ` 特性门控,则可以将双栈 ` --node-ip `
163
- 值传递给 kubelet。此特性需要保证云提供商支持双栈集群。
164
-
165
156
<!--
166
157
## Services
167
158
-->
168
- ## 服务 {#services}
159
+ ## Service {#services}
169
160
170
161
<!--
171
162
You can create {{< glossary_tooltip text="Services" term_id="service" >}} which can use IPv4, IPv6, or both.
@@ -179,10 +170,10 @@ set the `.spec.ipFamilyPolicy` field to one of the following values:
179
170
你可以使用 IPv4 或 IPv6 地址来创建
180
171
{{< glossary_tooltip text="Service" term_id="service" >}}。
181
172
182
- 服务的地址族默认为第一个服务集群 IP 范围的地址族(通过 kube-apiserver 的
173
+ Service 的地址族默认为第一个服务集群 IP 范围的地址族(通过 kube-apiserver 的
183
174
` --service-cluster-ip-range ` 参数配置)。
184
175
185
- 当你定义服务时 ,可以选择将其配置为双栈。若要指定所需的行为,你可以设置
176
+ 当你定义 Service 时 ,可以选择将其配置为双栈。若要指定所需的行为,你可以设置
186
177
` .spec.ipFamilyPolicy ` 字段为以下值之一:
187
178
188
179
<!--
@@ -194,10 +185,10 @@ set the `.spec.ipFamilyPolicy` field to one of the following values:
194
185
* Selects the `.spec.ClusterIP` from the list of `.spec.ClusterIPs` based on the address family
195
186
of the first element in the `.spec.ipFamilies` array.
196
187
-->
197
- * ` SingleStack ` :单栈服务 。控制面使用第一个配置的服务集群 IP 范围为服务分配集群 IP。
188
+ * ` SingleStack ` :单栈 Service 。控制面使用第一个配置的服务集群 IP 范围为 Service 分配集群 IP。
198
189
* ` PreferDualStack ` :
199
- * 为服务分配 IPv4 和 IPv6 集群 IP 地址。
200
- * ` RequireDualStack ` :从 IPv4 和 IPv6 的地址范围分配服务的 ` .spec.ClusterIPs `
190
+ * 为 Service 分配 IPv4 和 IPv6 集群 IP 地址。
191
+ * ` RequireDualStack ` :从 IPv4 和 IPv6 的地址范围分配 Service 的 ` .spec.ClusterIPs `
201
192
* 从基于在 ` .spec.ipFamilies ` 数组中第一个元素的地址族的 ` .spec.ClusterIPs `
202
193
列表中选择 ` .spec.ClusterIP `
203
194
@@ -207,15 +198,15 @@ families for dual-stack, you can choose the address families by setting an optio
207
198
`.spec.ipFamilies`, on the Service.
208
199
-->
209
200
如果你想要定义哪个 IP 族用于单栈或定义双栈 IP 族的顺序,可以通过设置
210
- 服务上的可选字段 ` .spec.ipFamilies ` 来选择地址族。
201
+ Service 上的可选字段 ` .spec.ipFamilies ` 来选择地址族。
211
202
212
203
{{< note >}}
213
204
<!--
214
205
The `.spec.ipFamilies` field is conditionally mutable: you can add or remove a secondary
215
206
IP address family, but you cannot change the primary IP address family of an existing Service.
216
207
-->
217
208
` .spec.ipFamilies ` 字段修改是有条件的:你可以添加或删除第二个 IP 地址族,
218
- 但你不能更改现有服务的主要 IP 地址族。
209
+ 但你不能更改现有 Service 的主要 IP 地址族。
219
210
{{< /note >}}
220
211
221
212
<!--
@@ -244,14 +235,14 @@ The first family you list is used for the legacy `.spec.ClusterIP` field.
244
235
245
236
These examples demonstrate the behavior of various dual-stack Service configuration scenarios.
246
237
-->
247
- ### 双栈服务配置场景 {#dual-stack-service-configuration-scenarios}
238
+ ### 双栈 Service 配置场景 {#dual-stack-service-configuration-scenarios}
248
239
249
- 以下示例演示多种双栈服务配置场景下的行为 。
240
+ 以下示例演示多种双栈 Service 配置场景下的行为 。
250
241
251
242
<!--
252
243
#### Dual-stack options on new Services
253
244
-->
254
- #### 新服务的双栈选项 {#dual-stack-options-on-new-services}
245
+ #### 新 Service 的双栈选项 {#dual-stack-options-on-new-services}
255
246
256
247
<!--
257
248
1. This Service specification does not explicitly define `.spec.ipFamilyPolicy`. When you create
@@ -261,12 +252,11 @@ These examples demonstrate the behavior of various dual-stack Service configurat
261
252
[headless Services](/docs/concepts/services-networking/service/#headless-services) with selectors
262
253
will behave in this same way.)
263
254
-->
264
- 1 . 此服务规约中没有显式设定 ` .spec.ipFamilyPolicy ` 。当你创建此服务时 ,Kubernetes
265
- 从所配置的第一个 ` service-cluster-ip-range ` 中为服务分配一个集群 IP,并设置
255
+ 1 . 此 Service 规约中没有显式设定 ` .spec.ipFamilyPolicy ` 。当你创建此 Service 时 ,Kubernetes
256
+ 从所配置的第一个 ` service-cluster-ip-range ` 中为 Service 分配一个集群 IP,并设置
266
257
` .spec.ipFamilyPolicy ` 为 ` SingleStack ` 。
267
- ([ 无选择算符的服务] ( /zh-cn/docs/concepts/services-networking/service/#services-without-selectors )
268
- 和[ 无头服务] ( /zh-cn/docs/concepts/services-networking/service/#headless-services ) 的行为方式
269
- 与此相同。)
258
+ ([ 无选择算符的 Service] ( /zh-cn/docs/concepts/services-networking/service/#services-without-selectors )
259
+ 和[ 无头服务(Headless Service)] ( /zh-cn/docs/concepts/services-networking/service/#headless-services ) 的行为方式与此相同。)
270
260
271
261
{{% code_sample file="service/networking/dual-stack-default-svc.yaml" %}}
272
262
@@ -285,14 +275,14 @@ These examples demonstrate the behavior of various dual-stack Service configurat
285
275
* On a cluster with dual-stack enabled, specifying `RequireDualStack` in `.spec.ipFamilyPolicy`
286
276
behaves the same as `PreferDualStack`.
287
277
-->
288
- 2 . 此服务规约显式地将 ` .spec.ipFamilyPolicy ` 设置为 ` PreferDualStack ` 。
289
- 当你在双栈集群上创建此服务时 ,Kubernetes 会为该服务分配 IPv4 和 IPv6 地址。
290
- 控制平面更新服务的 ` .spec ` 以记录 IP 地址分配。
278
+ 2 . 此 Service 规约显式地将 ` .spec.ipFamilyPolicy ` 设置为 ` PreferDualStack ` 。
279
+ 当你在双栈集群上创建此 Service 时 ,Kubernetes 会为此 Service 分配 IPv4 和 IPv6 地址。
280
+ 控制平面更新 Service 的 ` .spec ` 以记录 IP 地址分配。
291
281
字段 ` .spec.ClusterIPs ` 是主要字段,包含两个分配的 IP 地址;` .spec.ClusterIP ` 是次要字段,
292
282
其取值从 ` .spec.ClusterIPs ` 计算而来。
293
283
294
- * 对于 ` .spec.ClusterIP ` 字段,控制面记录来自第一个服务集群 IP 范围
295
- 对应的地址族的 IP 地址。
284
+ * 对于 ` .spec.ClusterIP ` 字段,控制面记录来自第一个服务集群 IP
285
+ 范围对应的地址族的 IP 地址。
296
286
* 对于单协议栈的集群,` .spec.ClusterIPs ` 和 ` .spec.ClusterIP ` 字段都
297
287
仅仅列出一个地址。
298
288
* 对于启用了双协议栈的集群,将 ` .spec.ipFamilyPolicy ` 设置为
@@ -306,8 +296,8 @@ These examples demonstrate the behavior of various dual-stack Service configurat
306
296
IPv4 address in `.spec.ClusterIPs`, `.spec.ClusterIP` is set to the IPv6 address because that is
307
297
the first element in the `.spec.ClusterIPs` array, overriding the default.
308
298
-->
309
- 3 . 下面的服务规约显式地在 ` .spec.ipFamilies ` 中指定 ` IPv6 ` 和 ` IPv4 ` ,并
310
- 将 ` .spec.ipFamilyPolicy ` 设定为 ` PreferDualStack ` 。
299
+ 3 . 下面的 Service 规约显式地在 ` .spec.ipFamilies ` 中指定 ` IPv6 ` 和 ` IPv4 ` ,并将
300
+ ` .spec.ipFamilyPolicy ` 设定为 ` PreferDualStack ` 。
311
301
当 Kubernetes 为 ` .spec.ClusterIPs ` 分配一个 IPv6 和一个 IPv4 地址时,
312
302
` .spec.ClusterIP ` 被设置成 IPv6 地址,因为它是 ` .spec.ClusterIPs ` 数组中的第一个元素,
313
303
覆盖其默认值。
@@ -317,14 +307,14 @@ These examples demonstrate the behavior of various dual-stack Service configurat
317
307
<!--
318
308
#### Dual-stack defaults on existing Services
319
309
-->
320
- #### 现有服务的双栈默认值 {#dual-stack-defaults-on-existing-services}
310
+ #### 现有 Service 的双栈默认值 {#dual-stack-defaults-on-existing-services}
321
311
322
312
<!--
323
313
These examples demonstrate the default behavior when dual-stack is newly enabled on a cluster
324
314
where Services already exist. (Upgrading an existing cluster to 1.21 or beyond will enable
325
315
dual-stack.)
326
316
-->
327
- 下面示例演示了在服务已经存在的集群上新启用双栈时的默认行为 。
317
+ 下面示例演示了在 Service 已经存在的集群上新启用双栈时的默认行为 。
328
318
(将现有集群升级到 1.21 或者更高版本会启用双协议栈支持。)
329
319
330
320
<!--
@@ -333,16 +323,16 @@ dual-stack.)
333
323
`.spec.ipFamilies` to the address family of the existing Service. The existing Service cluster IP
334
324
will be stored in `.spec.ClusterIPs`.
335
325
-->
336
- 1 . 在集群上启用双栈时,控制面会将现有服务 (无论是 ` IPv4 ` 还是 ` IPv6 ` )配置
326
+ 1 . 在集群上启用双栈时,控制面会将现有 Service (无论是 ` IPv4 ` 还是 ` IPv6 ` )配置
337
327
` .spec.ipFamilyPolicy ` 为 ` SingleStack ` 并设置 ` .spec.ipFamilies `
338
- 为服务的当前地址族 。
328
+ 为 Service 的当前地址族 。
339
329
340
330
{{% code_sample file="service/networking/dual-stack-default-svc.yaml" %}}
341
331
342
332
<!--
343
333
You can validate this behavior by using kubectl to inspect an existing service.
344
334
-->
345
- 你可以通过使用 kubectl 检查现有服务来验证此行为 。
335
+ 你可以通过使用 kubectl 检查现有 Service 来验证此行为 。
346
336
347
337
``` shell
348
338
kubectl get svc my-service -o yaml
@@ -423,12 +413,12 @@ dual-stack.)
423
413
<!--
424
414
# ### Switching Services between single-stack and dual-stack
425
415
-->
426
- # ### 在单栈和双栈之间切换服务 {#switching-services-between-single-stack-and-dual-stack}
416
+ # ### 在单栈和双栈之间切换 Service {#switching-services-between-single-stack-and-dual-stack}
427
417
428
418
<!--
429
419
Services can be changed from single-stack to dual-stack and from dual-stack to single-stack.
430
420
-->
431
- 服务可以从单栈更改为双栈 ,也可以从双栈更改为单栈。
421
+ Service 可以从单栈更改为双栈 ,也可以从双栈更改为单栈。
432
422
433
423
<!--
434
424
1. To change a Service from single-stack to dual-stack, change `.spec.ipFamilyPolicy` from
@@ -438,11 +428,11 @@ Services can be changed from single-stack to dual-stack and from dual-stack to s
438
428
439
429
Edit the Service specification updating the `.spec.ipFamilyPolicy` from `SingleStack` to `PreferDualStack`.
440
430
-->
441
- 1. 要将服务从单栈更改为双栈 ,根据需要将 `.spec.ipFamilyPolicy` 从 `SingleStack` 改为
431
+ 1. 要将 Service 从单栈更改为双栈 ,根据需要将 `.spec.ipFamilyPolicy` 从 `SingleStack` 改为
442
432
` PreferDualStack` 或 `RequireDualStack`。
443
- 当你将此服务从单栈更改为双栈时 ,Kubernetes 将分配缺失的地址族,
444
- 以便现在该服务具有 IPv4 和 IPv6 地址。
445
- 编辑服务规约将 `.spec.ipFamilyPolicy` 从 `SingleStack` 改为 `PreferDualStack`。
433
+ 当你将此 Service 从单栈更改为双栈时 ,Kubernetes 将分配缺失的地址族,
434
+ 以便现在此 Service具有 IPv4 和 IPv6 地址。
435
+ 编辑 Service 规约将 `.spec.ipFamilyPolicy` 从 `SingleStack` 改为 `PreferDualStack`。
446
436
447
437
<!--
448
438
Before :
@@ -471,9 +461,9 @@ Services can be changed from single-stack to dual-stack and from dual-stack to s
471
461
array, and sets `.spec.ClusterIP` to that IP address and sets `.spec.ipFamilies` to the address
472
462
family of `.spec.ClusterIPs`.
473
463
-->
474
- 2. 要将服务从双栈更改为单栈 ,请将 `.spec.ipFamilyPolicy` 从 `PreferDualStack` 或
464
+ 2. 要将 Service 从双栈更改为单栈 ,请将 `.spec.ipFamilyPolicy` 从 `PreferDualStack` 或
475
465
` RequireDualStack` 改为 `SingleStack`。
476
- 当你将此服务从双栈更改为单栈时 ,Kubernetes 只保留 `.spec.ClusterIPs`
466
+ 当你将此 Service 从双栈更改为单栈时 ,Kubernetes 只保留 `.spec.ClusterIPs`
477
467
数组中的第一个元素,并设置 `.spec.ClusterIP` 为那个 IP 地址,
478
468
并设置 `.spec.ipFamilies` 为 `.spec.ClusterIPs` 地址族。
479
469
@@ -494,15 +484,15 @@ and without `.spec.ipFamilyPolicy` explicitly set, the `.spec.ipFamilyPolicy` fi
494
484
<!--
495
485
# ## Service type LoadBalancer
496
486
-->
497
- # ## LoadBalancer 类型服务 {#service-type-loadbalancer}
487
+ # ## LoadBalancer 类型 Service {#service-type-loadbalancer}
498
488
499
489
<!--
500
490
To provision a dual-stack load balancer for your Service :
501
491
502
492
* Set the `.spec.type` field to `LoadBalancer`
503
493
* Set `.spec.ipFamilyPolicy` field to `PreferDualStack` or `RequireDualStack`
504
494
-->
505
- 要为你的服务提供双栈负载均衡器 :
495
+ 要为你的 Service 提供双栈负载均衡器 :
506
496
507
497
* 将 `.spec.type` 字段设置为 `LoadBalancer`
508
498
* 将 `.spec.ipFamilyPolicy` 字段设置为 `PreferDualStack` 或者 `RequireDualStack`
@@ -512,7 +502,7 @@ To provision a dual-stack load balancer for your Service:
512
502
To use a dual-stack `LoadBalancer` type Service, your cloud provider must support IPv4 and IPv6
513
503
load balancers.
514
504
-->
515
- 为了使用双栈的负载均衡器类型服务 ,你的云驱动必须支持 IPv4 和 IPv6 的负载均衡器。
505
+ 为了使用双栈的负载均衡器类型 Service ,你的云驱动必须支持 IPv4 和 IPv6 的负载均衡器。
516
506
{{< /note >}}
517
507
518
508
<!--
@@ -552,15 +542,15 @@ You can use IPv4/IPv6 dual-stack networking with `l2bridge` networks.
552
542
# # Windows 支持 {#windows-support}
553
543
554
544
Windows 上的 Kubernetes 不支持单栈“仅 IPv6” 网络。 然而,
555
- 对于 Pod 和节点而言,仅支持单栈形式服务的双栈 IPv4/IPv6 网络是被支持的。
545
+ 对于 Pod 和节点而言,仅支持单栈形式 Service 的双栈 IPv4/IPv6 网络是被支持的。
556
546
557
547
你可以使用 `l2bridge` 网络来实现 IPv4/IPv6 双栈联网。
558
548
559
549
{{< note >}}
560
550
<!--
561
551
Overlay (VXLAN) networks on Windows **do not** support dual-stack networking.
562
552
-->
563
- Windows 上的 Overlay ( VXLAN) 网络**不**支持双栈网络。
553
+ Windows 上的 Overlay( VXLAN) 网络**不**支持双栈网络。
564
554
{{< /note >}}
565
555
566
556
<!--
0 commit comments