Skip to content

Commit aad5522

Browse files
authored
Merge pull request #33380 from JarHMJ/docs/concepts/services-networking/dual-stack.md
[zh] update content/zh/docs/concepts/services-networking/dual-stack.md
2 parents b97dfa0 + de70c8d commit aad5522

File tree

1 file changed

+17
-22
lines changed

1 file changed

+17
-22
lines changed

content/zh/docs/concepts/services-networking/dual-stack.md

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ weight: 70
2626

2727
<!-- overview -->
2828

29-
{{< feature-state for_k8s_version="v1.21" state="beta" >}}
29+
{{< feature-state for_k8s_version="v1.23" state="stable" >}}
3030

3131
<!--
3232
IPv4/IPv6 dual-stack networking enables the allocation of both IPv4 and IPv6 addresses to {{< glossary_tooltip text="Pods" term_id="pod" >}} and {{< glossary_tooltip text="Services" term_id="service" >}}.
@@ -91,12 +91,6 @@ The following prerequisites are needed in order to utilize IPv4/IPv6 dual-stack
9191
-->
9292
## 配置 IPv4/IPv6 双协议栈
9393

94-
<!--
95-
To use IPv4/IPv6 dual-stack, ensure the `IPv6DualStack` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/) is enabled for the relevant components of your cluster. (Starting in 1.21, IPv4/IPv6 dual-stack defaults to enabled.)
96-
-->
97-
要使用 IPv4/IPv6 双协议栈,确保为集群的相关组件启用 `IPv6DualStack`
98-
[特性门控](/zh/docs/reference/command-line-tools-reference/feature-gates/)
99-
(从 1.21 版本开始,IPv4/IPv6 双协议栈默认是被启用的)。
10094

10195
<!--
10296
* kube-apiserver:
@@ -107,6 +101,14 @@ To use IPv4/IPv6 dual-stack, ensure the `IPv6DualStack` [feature gate](/docs/ref
107101
* `--node-cidr-mask-size-ipv4|--node-cidr-mask-size-ipv6` defaults to /24 for IPv4 and /64 for IPv6
108102
* kube-proxy:
109103
* `--cluster-cidr=<IPv4 CIDR>,<IPv6 CIDR>`
104+
* kubelet:
105+
* when there is no `--cloud-provider` the administrator can pass a comma-separated pair
106+
of IP addresses via `--node-ip` to manually configure dual-stack `.status.addresses`
107+
for that Node.
108+
If a Pod runs on that node in HostNetwork mode, the Pod reports these IP addresses in its
109+
`.status.podIPs` field.
110+
All `podIPs` in a node match the IP family preference defined by the
111+
`.status.addresses` field for that Node.
110112
-->
111113
* kube-apiserver:
112114
* `--service-cluster-ip-range=<IPv4 CIDR>,<IPv6 CIDR>`
@@ -116,6 +118,11 @@ To use IPv4/IPv6 dual-stack, ensure the `IPv6DualStack` [feature gate](/docs/ref
116118
* `--node-cidr-mask-size-ipv4|--node-cidr-mask-size-ipv6` 对于 IPv4 默认为 /24,对于 IPv6 默认为 /64
117119
* kube-proxy:
118120
* `--cluster-cidr=<IPv4 CIDR>,<IPv6 CIDR>`
121+
* kubelet:
122+
* 当没有 `--cloud-provider` 时,管理员可以通过 `--node-ip` 来传递逗号分隔的 IP 地址,
123+
为该节点手动配置双栈 `.status.addresses`
124+
如果 Pod 以 HostNetwork 模式在该节点上运行,则 Pod 会用 `.status.podIPs` 字段来报告它的 IP 地址。
125+
一个节点中的所有 `podIP` 都会匹配该节点的由 `.status.addresses` 字段定义的 IP 组。
119126

120127
{{< note >}}
121128
<!--
@@ -127,15 +134,6 @@ IPv4 CIDR 的一个例子:`10.244.0.0/16`(尽管你会提供你自己的地
127134

128135
IPv6 CIDR 的一个例子:`fdXY:IJKL:MNOP:15::/64`
129136
(这里演示的是格式而非有效地址 - 请看 [RFC 4193](https://tools.ietf.org/html/rfc4193))。
130-
<!--
131-
Starting in 1.21, IPv4/IPv6 dual-stack defaults to enabled.
132-
You can disable it when necessary by specifying `--feature-gates="IPv6DualStack=false"`
133-
on the kube-apiserver, kube-controller-manager, kubelet, and kube-proxy command line.
134-
-->
135-
从 1.21 开始 IPv4/IPv6 双协议栈默认为启用状态。
136-
你可以在必要的时候通过为 kube-apiserver、kube-controller-manager、kubelet
137-
和 kube-proxy 命令行设置 `--feature-gates="IPv6DualStack=false"` 来禁用
138-
此特性。
139137
{{< /note >}}
140138

141139
<!--
@@ -161,16 +159,14 @@ set the `.spec.ipFamilyPolicy` field to one of the following values:
161159
<!--
162160
* `SingleStack`: Single-stack service. The control plane allocates a cluster IP for the Service, using the first configured service cluster IP range.
163161
* `PreferDualStack`:
164-
* Allocates IPv4 and IPv6 cluster IPs for the Service. (If the cluster has `--feature-gates="IPv6DualStack=false"`, this setting follows the same behavior as `SingleStack`.)
162+
* Allocates IPv4 and IPv6 cluster IPs for the Service.
165163
* `RequireDualStack`: Allocates Service `.spec.ClusterIPs` from both IPv4 and IPv6 address ranges.
166164
* Selects the `.spec.ClusterIP` from the list of `.spec.ClusterIPs` based on the address family of the first element in the `.spec.ipFamilies` array.
167165
-->
168166

169167
* `SingleStack`:单栈服务。控制面使用第一个配置的服务集群 IP 范围为服务分配集群 IP。
170168
* `PreferDualStack`
171169
* 为服务分配 IPv4 和 IPv6 集群 IP 地址。
172-
(如果集群设置了 `--feature-gates="IPv6DualStack=false"`,则此设置的行为与
173-
`SingleStack` 设置相同。)
174170
* `RequireDualStack`:从 IPv4 和 IPv6 的地址范围分配服务的 `.spec.ClusterIPs`
175171
* 从基于在 `.spec.ipFamilies` 数组中第一个元素的地址族的 `.spec.ClusterIPs`
176172
列表中选择 `.spec.ClusterIP`
@@ -278,11 +274,10 @@ These examples demonstrate the behavior of various dual-stack Service configurat
278274
#### 现有服务的双栈默认值
279275

280276
<!--
281-
These examples demonstrate the default behavior when dual-stack is newly enabled on a cluster where Services already exist. (Upgrading an existing cluster to 1.21 will enable dual-stack unless `--feature-gates="IPv6DualStack=false"` is set.)
277+
These examples demonstrate the default behavior when dual-stack is newly enabled on a cluster where Services already exist. (Upgrading an existing cluster to 1.21 or beyond will enable dual-stack.)
282278
-->
283279
下面示例演示了在服务已经存在的集群上新启用双栈时的默认行为。
284-
(将现有集群升级到 1.21 会启用双协议栈支持,除非设置了
285-
`--feature-gates="IPv6DualStack=false"`
280+
(将现有集群升级到 1.21 或者更高版本会启用双协议栈支持。)
286281

287282
<!--
288283
1. When dual-stack is enabled on a cluster, existing Services (whether `IPv4` or `IPv6`) are configured by the control plane to set `.spec.ipFamilyPolicy` to `SingleStack` and set `.spec.ipFamilies` to the address family of the existing Service. The existing Service cluster IP will be stored in `.spec.ClusterIPs`.

0 commit comments

Comments
 (0)