Skip to content

Commit 446ff44

Browse files
authored
Merge pull request #48728 from windsonsea/dualpor
[zh] Sync kubeadm/dual-stack-support.md
2 parents 851aa25 + 27d3e07 commit 446ff44

File tree

1 file changed

+89
-16
lines changed

1 file changed

+89
-16
lines changed

content/zh-cn/docs/setup/production-environment/tools/kubeadm/dual-stack-support.md

Lines changed: 89 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,55 @@ following the steps from [Installing kubeadm](/docs/setup/production-environment
4040

4141
<!--
4242
For each server that you want to use as a {{< glossary_tooltip text="node" term_id="node" >}},
43-
make sure it allows IPv6 forwarding. On Linux, you can set this by running run
44-
`sysctl -w net.ipv6.conf.all.forwarding=1` as the root user on each server.
43+
make sure it allows IPv6 forwarding.
4544
-->
4645
针对你要作为{{< glossary_tooltip text="节点" term_id="node" >}}使用的每台服务器,
47-
确保其允许 IPv6 转发。在 Linux 节点上,你可以通过以 root 用户在每台服务器上运行
48-
`sysctl -w net.ipv6.conf.all.forwarding=1` 来完成设置。
46+
确保其允许 IPv6 转发。
47+
48+
<!--
49+
### Enable IPv6 packet forwarding {#prerequisite-ipv6-forwarding}
50+
51+
To check if IPv6 packet forwarding is enabled:
52+
-->
53+
### 启用 IPv6 数据包转发 {#prerequisite-ipv6-forwarding}
54+
55+
检查 IPv6 数据包转发是否已被启用:
56+
57+
```bash
58+
sysctl net.ipv6.conf.all.forwarding
59+
```
60+
61+
<!--
62+
If the output is `net.ipv6.conf.all.forwarding = 1` it is already enabled.
63+
Otherwise it is not enabled yet.
64+
65+
To manually enable IPv6 packet forwarding:
66+
-->
67+
如果输出为 `net.ipv6.conf.all.forwarding = 1`,IPv6 数据包转发已被启用。
68+
否则,IPv6 数据包转发尚未被启用。
69+
70+
手动启用 IPv6 数据包转发:
71+
72+
<!--
73+
```bash
74+
# sysctl params required by setup, params persist across reboots
75+
cat <<EOF | sudo tee -a /etc/sysctl.d/k8s.conf
76+
net.ipv6.conf.all.forwarding = 1
77+
EOF
78+
79+
# Apply sysctl params without reboot
80+
sudo sysctl --system
81+
```
82+
-->
83+
```bash
84+
# 设置所需的 sysctl 参数,这些参数在重启后仍然有效
85+
cat <<EOF | sudo tee -a /etc/sysctl.d/k8s.conf
86+
net.ipv6.conf.all.forwarding = 1
87+
EOF
88+
89+
# 应用 sysctl 参数而无需重启
90+
sudo sysctl --system
91+
```
4992

5093
<!--
5194
You need to have an IPv4 and and IPv6 address range to use. Cluster operators typically
@@ -56,8 +99,8 @@ You don't have to route the cluster's IP address ranges to the public internet.
5699
The size of the IP address allocations should be suitable for the number of Pods and
57100
Services that you are planning to run.
58101
-->
59-
你需要一个可以使用的 IPv4 和 IPv6 地址范围。集群操作人员通常对于 IPv4 使用
60-
私有地址范围。对于 IPv6,集群操作人员通常会基于分配给该操作人员的地址范围
102+
你需要一个可以使用的 IPv4 和 IPv6 地址范围。集群操作人员通常对 IPv4 使用
103+
私有的地址范围。对于 IPv6,集群操作人员通常会基于分配给他自己的地址范围
61104
`2000::/3` 中选择一个全局的单播地址块。你不需要将集群的 IP 地址范围路由到公众互联网。
62105

63106
所分配的 IP 地址数量应该与你计划运行的 Pod 和 Service 的数量相适应。
@@ -69,7 +112,7 @@ If you are upgrading an existing cluster with the `kubeadm upgrade` command,
69112
(“cluster CIDR”) nor to the cluster's Service address range (“Service CIDR”).
70113
-->
71114
如果你在使用 `kubeadm upgrade` 命令升级现有的集群,`kubeadm` 不允许更改 Pod
72-
的 IP 地址范围(“集群 CIDR”),也不允许更改集群的服务地址范围(“Service CIDR”)。
115+
的 IP 地址范围(“集群 CIDR”),也不允许更改集群的 Service 地址范围(“Service CIDR”)。
73116
{{< /note >}}
74117

75118
<!--
@@ -91,8 +134,8 @@ kubeadm init --pod-network-cidr=10.244.0.0/16,2001:db8:42:0::/56 --service-cidr=
91134
```
92135

93136
<!--
94-
To make things clearer, here is an example kubeadm
95-
[configuration file](/docs/reference/config-api/kubeadm-config.v1beta4/)
137+
To make things clearer, here is an example kubeadm
138+
[configuration file](/docs/reference/config-api/kubeadm-config.v1beta4/)
96139
`kubeadm-config.yaml` for the primary dual-stack control plane node.
97140
-->
98141
为了更便于理解,参看下面的名为 `kubeadm-config.yaml` 的 kubeadm
@@ -162,14 +205,27 @@ Here is an example kubeadm [configuration file](/docs/reference/config-api/kubea
162205
在添加节点之前,请确保该节点具有 IPv6 可路由的网络接口并且启用了 IPv6 转发。
163206

164207
下面的名为 `kubeadm-config.yaml` 的 kubeadm
165-
[配置文件](/zh-cn/docs/reference/config-api/kubeadm-config.v1beta4/)
166-
示例用于向集群中添加工作节点。
208+
[配置文件](/zh-cn/docs/reference/config-api/kubeadm-config.v1beta4/)示例用于向集群中添加工作节点。
167209

168210
<!--
169-
# change auth info above to match the actual token and CA certificate hash for your cluster
211+
```yaml
212+
apiVersion: kubeadm.k8s.io/v1beta4
213+
kind: JoinConfiguration
214+
discovery:
215+
bootstrapToken:
216+
apiServerEndpoint: 10.100.0.1:6443
217+
token: "clvldh.vjjwg16ucnhp94qr"
218+
caCertHashes:
219+
- "sha256:a4863cde706cfc580a439f842cc65d5ef112b7b2be31628513a9881cf0d9fe0e"
220+
# change auth info above to match the actual token and CA certificate hash for your cluster
221+
nodeRegistration:
222+
kubeletExtraArgs:
223+
- name: "node-ip"
224+
value: "10.100.0.2,fd00:1:2:3::3"
225+
```
170226
-->
171227
```yaml
172-
apiVersion: kubeadm.k8s.io/v1beta3
228+
apiVersion: kubeadm.k8s.io/v1beta4
173229
kind: JoinConfiguration
174230
discovery:
175231
bootstrapToken:
@@ -189,11 +245,28 @@ Also, here is an example kubeadm [configuration file](/docs/reference/config-api
189245
`kubeadm-config.yaml` for joining another control plane node to the cluster.
190246
-->
191247
下面的名为 `kubeadm-config.yaml` 的 kubeadm
192-
[配置文件](/zh-cn/docs/reference/config-api/kubeadm-config.v1beta4/)
193-
示例用于向集群中添加另一个控制面节点。
248+
[配置文件](/zh-cn/docs/reference/config-api/kubeadm-config.v1beta4/)示例用于向集群中添加另一个控制面节点。
194249

195250
<!--
196-
# change auth info above to match the actual token and CA certificate hash for your cluster
251+
```yaml
252+
apiVersion: kubeadm.k8s.io/v1beta4
253+
kind: JoinConfiguration
254+
controlPlane:
255+
localAPIEndpoint:
256+
advertiseAddress: "10.100.0.2"
257+
bindPort: 6443
258+
discovery:
259+
bootstrapToken:
260+
apiServerEndpoint: 10.100.0.1:6443
261+
token: "clvldh.vjjwg16ucnhp94qr"
262+
caCertHashes:
263+
- "sha256:a4863cde706cfc580a439f842cc65d5ef112b7b2be31628513a9881cf0d9fe0e"
264+
# change auth info above to match the actual token and CA certificate hash for your cluster
265+
nodeRegistration:
266+
kubeletExtraArgs:
267+
- name: "node-ip"
268+
value: "10.100.0.2,fd00:1:2:3::4"
269+
```
197270
-->
198271
```yaml
199272
apiVersion: kubeadm.k8s.io/v1beta4

0 commit comments

Comments
 (0)