Skip to content

Commit 6013fb1

Browse files
authored
Merge pull request #42094 from windsonsea/kubesy
[zh] sync dual-stack-support.md and kubespray.md
2 parents 76643c7 + 0da1b10 commit 6013fb1

File tree

2 files changed

+75
-31
lines changed

2 files changed

+75
-31
lines changed

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

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ content_type: task
44
weight: 100
55
min-kubernetes-server-version: 1.21
66
---
7-
87
<!--
98
title: Dual-stack support with kubeadm
109
content_type: task
@@ -17,28 +16,35 @@ min-kubernetes-server-version: 1.21
1716
{{< feature-state for_k8s_version="v1.23" state="stable" >}}
1817

1918
<!--
20-
Your Kubernetes cluster includes [dual-stack](/docs/concepts/services-networking/dual-stack/) networking, which means that cluster networking lets you use either address family. In a cluster, the control plane can assign both an IPv4 address and an IPv6 address to a single {{< glossary_tooltip text="Pod" term_id="pod" >}} or a {{< glossary_tooltip text="Service" term_id="service" >}}.
19+
Your Kubernetes cluster includes [dual-stack](/docs/concepts/services-networking/dual-stack/)
20+
networking, which means that cluster networking lets you use either address family.
21+
In a cluster, the control plane can assign both an IPv4 address and an IPv6 address to a single
22+
{{< glossary_tooltip text="Pod" term_id="pod" >}} or a {{< glossary_tooltip text="Service" term_id="service" >}}.
2123
-->
2224
你的集群包含[双协议栈](/zh-cn/docs/concepts/services-networking/dual-stack/)组网支持,
2325
这意味着集群网络允许你在两种地址族间任选其一。在集群中,控制面可以为同一个
24-
{{< glossary_tooltip text="Pod" term_id="pod" >}} 或者 {{< glossary_tooltip text="Service" term_id="service" >}}
26+
{{< glossary_tooltip text="Pod" term_id="pod" >}} 或者
27+
{{< glossary_tooltip text="Service" term_id="service" >}}
2528
同时赋予 IPv4 和 IPv6 地址。
2629

2730
<!-- body -->
2831

2932
## {{% heading "prerequisites" %}}
3033

3134
<!--
32-
You need to have installed the {{< glossary_tooltip text="kubeadm" term_id="kubeadm" >}} tool, following the steps from [Installing kubeadm](/docs/setup/production-environment/tools/kubeadm/install-kubeadm/).
35+
You need to have installed the {{< glossary_tooltip text="kubeadm" term_id="kubeadm" >}} tool,
36+
following the steps from [Installing kubeadm](/docs/setup/production-environment/tools/kubeadm/install-kubeadm/).
3337
-->
3438
你需要已经遵从[安装 kubeadm](/zh-cn/docs/setup/production-environment/tools/kubeadm/install-kubeadm/)
3539
中所给的步骤安装了 {{< glossary_tooltip text="kubeadm" term_id="kubeadm" >}} 工具。
3640

3741
<!--
38-
For each server that you want to use as a {{< glossary_tooltip text="node" term_id="node" >}}, make sure it allows IPv6 forwarding. On Linux, you can set this by running run `sysctl -w net.ipv6.conf.all.forwarding=1` as the root user on each server.
42+
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.
3945
-->
4046
针对你要作为{{< glossary_tooltip text="节点" term_id="node" >}}使用的每台服务器,
41-
确保其允许 IPv6 转发。在 Linux 节点上,你可以通过以 root 用户在每台服务器上运行
47+
确保其允许 IPv6 转发。在 Linux 节点上,你可以通过以 root 用户在每台服务器上运行
4248
`sysctl -w net.ipv6.conf.all.forwarding=1` 来完成设置。
4349

4450
<!--
@@ -50,10 +56,9 @@ You don't have to route the cluster's IP address ranges to the public internet.
5056
The size of the IP address allocations should be suitable for the number of Pods and
5157
Services that you are planning to run.
5258
-->
53-
你需要一个可以使用的 IPv4 和 IPv6 地址范围。集群操作人员通常为 IPv4 使用
59+
你需要一个可以使用的 IPv4 和 IPv6 地址范围。集群操作人员通常对于 IPv4 使用
5460
私有地址范围。对于 IPv6,集群操作人员通常会基于分配给该操作人员的地址范围,
55-
`2000::/3` 中选择一个全局的单播地址块。你不需要将集群的 IP 地址范围路由
56-
到公众互联网。
61+
`2000::/3` 中选择一个全局的单播地址块。你不需要将集群的 IP 地址范围路由到公众互联网。
5762

5863
所分配的 IP 地址数量应该与你计划运行的 Pod 和 Service 的数量相适应。
5964

@@ -77,6 +82,9 @@ similar to the following example:
7782

7883
要使用 `kubeadm init` 创建一个双协议栈集群,你可以传递与下面的例子类似的命令行参数:
7984

85+
<!--
86+
# These address ranges are examples
87+
-->
8088
```shell
8189
# 这里的地址范围仅作示例使用
8290
kubeadm init --pod-network-cidr=10.244.0.0/16,2001:db8:42:0::/56 --service-cidr=10.96.0.0/16,2001:db8:42:1::/112
@@ -110,7 +118,9 @@ nodeRegistration:
110118
```
111119
112120
<!--
113-
`advertiseAddress` in InitConfiguration specifies the IP address that the API Server will advertise it is listening on. The value of `advertiseAddress` equals the `--apiserver-advertise-address` flag of `kubeadm init`
121+
`advertiseAddress` in InitConfiguration specifies the IP address that the API Server
122+
will advertise it is listening on. The value of `advertiseAddress` equals the
123+
`--apiserver-advertise-address` flag of `kubeadm init`.
114124

115125
Run kubeadm to initiate the dual-stack control plane node:
116126
-->
@@ -125,7 +135,8 @@ kubeadm init --config=kubeadm-config.yaml
125135
```
126136

127137
<!--
128-
The kube-controller-manager flags `--node-cidr-mask-size-ipv4|--node-cidr-mask-size-ipv6` are set with default values. See [configure IPv4/IPv6 dual stack](/docs/concepts/services-networking/dual-stack#configure-ipv4-ipv6-dual-stack).
138+
The kube-controller-manager flags `--node-cidr-mask-size-ipv4|--node-cidr-mask-size-ipv6`
139+
are set with default values. See [configure IPv4/IPv6 dual stack](/docs/concepts/services-networking/dual-stack#configure-ipv4-ipv6-dual-stack).
129140
-->
130141
kube-controller-manager 标志 `--node-cidr-mask-size-ipv4|--node-cidr-mask-size-ipv6`
131142
是使用默认值来设置的。参见[配置 IPv4/IPv6 双协议栈](/zh-cn/docs/concepts/services-networking/dual-stack#configure-ipv4-ipv6-dual-stack)。
@@ -153,6 +164,9 @@ Here is an example kubeadm [configuration file](/docs/reference/config-api/kubea
153164
[配置文件](/zh-cn/docs/reference/config-api/kubeadm-config.v1beta3/)
154165
示例用于向集群中添加工作节点。
155166

167+
<!--
168+
# change auth info above to match the actual token and CA certificate hash for your cluster
169+
-->
156170
```yaml
157171
apiVersion: kubeadm.k8s.io/v1beta3
158172
kind: JoinConfiguration
@@ -176,6 +190,9 @@ Also, here is an example kubeadm [configuration file](/docs/reference/config-api
176190
[配置文件](/zh-cn/docs/reference/config-api/kubeadm-config.v1beta3/)
177191
示例用于向集群中添加另一个控制面节点。
178192

193+
<!--
194+
# change auth info above to match the actual token and CA certificate hash for your cluster
195+
-->
179196
```yaml
180197
apiVersion: kubeadm.k8s.io/v1beta3
181198
kind: JoinConfiguration
@@ -196,7 +213,9 @@ nodeRegistration:
196213
```
197214

198215
<!--
199-
`advertiseAddress` in JoinConfiguration.controlPlane specifies the IP address that the API Server will advertise it is listening on. The value of `advertiseAddress` equals the `--apiserver-advertise-address` flag of `kubeadm join`.
216+
`advertiseAddress` in JoinConfiguration.controlPlane specifies the IP address that the
217+
API Server will advertise it is listening on. The value of `advertiseAddress` equals
218+
the `--apiserver-advertise-address` flag of `kubeadm join`.
200219
-->
201220
JoinConfiguration.controlPlane 中的 `advertiseAddress` 设定 API 服务器将公告自身要监听的
202221
IP 地址。`advertiseAddress` 的取值与 `kubeadm join` 的标志
@@ -246,5 +265,4 @@ networking:
246265
-->
247266
* [验证 IPv4/IPv6 双协议栈](/zh-cn/docs/tasks/network/validate-dual-stack)联网
248267
* 阅读[双协议栈](/zh-cn/docs/concepts/services-networking/dual-stack/)集群网络
249-
* 进一步了解 kubeadm [配置格式](/docs/reference/config-api/kubeadm-config.v1beta3/)
250-
268+
* 进一步了解 kubeadm [配置格式](/zh-cn/docs/reference/config-api/kubeadm-config.v1beta3/)

content/zh-cn/docs/setup/production-environment/tools/kubespray.md

Lines changed: 43 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,18 @@ weight: 30
1212
<!-- overview -->
1313

1414
<!--
15-
This quickstart helps to install a Kubernetes cluster hosted on GCE, Azure, OpenStack, AWS, vSphere, Equinix Metal (formerly Packet), Oracle Cloud Infrastructure (Experimental) or Baremetal with [Kubespray](https://github.com/kubernetes-sigs/kubespray).
15+
This quickstart helps to install a Kubernetes cluster hosted on GCE, Azure, OpenStack,
16+
AWS, vSphere, Equinix Metal (formerly Packet), Oracle Cloud Infrastructure (Experimental)
17+
or Baremetal with [Kubespray](https://github.com/kubernetes-sigs/kubespray).
1618
-->
1719
此快速入门有助于使用 [Kubespray](https://github.com/kubernetes-sigs/kubespray)
1820
安装在 GCE、Azure、OpenStack、AWS、vSphere、Equinix Metal(曾用名 Packet)、Oracle Cloud
1921
Infrastructure(实验性)或 Baremetal 上托管的 Kubernetes 集群。
2022

2123
<!--
22-
Kubespray is a composition of [Ansible](https://docs.ansible.com/) playbooks, [inventory](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/ansible.md#inventory), provisioning tools, and domain knowledge for generic OS/Kubernetes clusters configuration management tasks.
24+
Kubespray is a composition of [Ansible](https://docs.ansible.com/) playbooks,
25+
[inventory](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/ansible.md#inventory),
26+
provisioning tools, and domain knowledge for generic OS/Kubernetes clusters configuration management tasks.
2327
2428
Kubespray provides:
2529
-->
@@ -65,7 +69,8 @@ Kubespray 提供:
6569
- 持续集成测试
6670

6771
<!--
68-
To choose a tool which best fits your use case, read [this comparison](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/comparisons.md) to
72+
To choose a tool which best fits your use case, read
73+
[this comparison](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/comparisons.md) to
6974
[kubeadm](/docs/reference/setup-tools/kubeadm/) and [kops](/docs/setup/production-environment/tools/kops/).
7075
-->
7176
要选择最适合你的用例的工具,请阅读
@@ -95,8 +100,11 @@ Provision servers with the following [requirements](https://github.com/kubernete
95100
* The target servers must have **access to the Internet** in order to pull docker images. Otherwise, additional configuration is required See ([Offline Environment](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/offline-environment.md))
96101
* The target servers are configured to allow **IPv4 forwarding**.
97102
* If using IPv6 for pods and services, the target servers are configured to allow **IPv6 forwarding**.
98-
* The **firewalls are not managed**, you'll need to implement your own rules the way you used to. in order to avoid any issue during deployment you should disable your firewall.
99-
* If kubespray is run from non-root user account, correct privilege escalation method should be configured in the target servers. Then the `ansible_become` flag or command parameters `--become` or `-b` should be specified.
103+
* The **firewalls are not managed**, you'll need to implement your own rules the way you used to.
104+
in order to avoid any issue during deployment you should disable your firewall.
105+
* If kubespray is run from non-root user account, correct privilege escalation method
106+
should be configured in the target servers. Then the `ansible_become` flag or command
107+
parameters `--become` or `-b` should be specified.
100108
-->
101109
* **Kubernetes** 的最低版本要求为 V1.22
102110
* **在将运行 Ansible 命令的计算机上安装 Ansible v2.11(或更高版本)、Jinja 2.11(或更高版本)和 python-netaddr**
@@ -126,7 +134,10 @@ Kubespray 提供以下实用程序来帮助你设置环境:
126134
<!--
127135
### (2/5) Compose an inventory file
128136
129-
After you provision your servers, create an [inventory file for Ansible](https://docs.ansible.com/ansible/latest/network/getting_started/first_inventory.html). You can do this manually or via a dynamic inventory script. For more information, see "[Building your own inventory](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/getting-started.md#building-your-own-inventory)".
137+
After you provision your servers, create an
138+
[inventory file for Ansible](https://docs.ansible.com/ansible/latest/network/getting_started/first_inventory.html).
139+
You can do this manually or via a dynamic inventory script. For more information,
140+
see "[Building your own inventory](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/getting-started.md#building-your-own-inventory)".
130141
131142
### (3/5) Plan your cluster deployment
132143
@@ -156,7 +167,7 @@ Kubespray 能够自定义部署的许多方面:
156167
* {{< glossary_tooltip term_id="cri-o" >}}
157168
* Certificate generation methods
158169
-->
159-
* 选择部署模式: kubeadm 或非 kubeadm
170+
* 选择部署模式:kubeadm 或非 kubeadm
160171
* CNI(网络)插件
161172
* DNS 配置
162173
* 控制平面的选择:本机/可执行文件或容器化
@@ -169,7 +180,10 @@ Kubespray 能够自定义部署的许多方面:
169180
* 证书生成方式
170181

171182
<!--
172-
Kubespray customizations can be made to a [variable file](https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html). If you are getting started with Kubespray, consider using the Kubespray defaults to deploy your cluster and explore Kubernetes.
183+
Kubespray customizations can be made to a
184+
[variable file](https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html).
185+
If you are getting started with Kubespray, consider using the Kubespray
186+
defaults to deploy your cluster and explore Kubernetes.
173187
-->
174188
可以修改[变量文件](https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html)以进行
175189
Kubespray 定制。
@@ -180,7 +194,8 @@ Kubespray 定制。
180194
181195
Next, deploy your cluster:
182196
183-
Cluster deployment using [ansible-playbook](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/getting-started.md#starting-custom-deployment).
197+
Cluster deployment using
198+
[ansible-playbook](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/getting-started.md#starting-custom-deployment).
184199
-->
185200
### (4/5)部署集群
186201

@@ -195,7 +210,9 @@ ansible-playbook -i your/inventory/inventory.ini cluster.yml -b -v \
195210
```
196211

197212
<!--
198-
Large deployments (100+ nodes) may require [specific adjustments](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/large-deployments.md) for best results.
213+
Large deployments (100+ nodes) may require
214+
[specific adjustments](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/large-deployments.md)
215+
for best results.
199216
-->
200217
大型部署(超过 100 个节点)
201218
可能需要[特定的调整](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/large-deployments.md)
@@ -204,7 +221,11 @@ Large deployments (100+ nodes) may require [specific adjustments](https://github
204221
<!--
205222
### (5/5) Verify the deployment
206223
207-
Kubespray provides a way to verify inter-pod connectivity and DNS resolve with [Netchecker](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/netcheck.md). Netchecker ensures the netchecker-agents pods can resolve DNS requests and ping each over within the default namespace. Those pods mimic similar behavior as the rest of the workloads and serve as cluster health indicators.
224+
Kubespray provides a way to verify inter-pod connectivity and DNS resolve with
225+
[Netchecker](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/netcheck.md).
226+
Netchecker ensures the netchecker-agents pods can resolve DNS requests and ping each
227+
over within the default namespace. Those pods mimic similar behavior as the rest
228+
of the workloads and serve as cluster health indicators.
208229
-->
209230
### (5/5)验证部署
210231

@@ -227,8 +248,10 @@ Kubespray 提供了其他 Playbook 来管理集群: **scale** 和 **upgrade**
227248
<!--
228249
### Scale your cluster
229250
230-
You can add worker nodes from your cluster by running the scale playbook. For more information, see "[Adding nodes](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/getting-started.md#adding-nodes)".
231-
You can remove worker nodes from your cluster by running the remove-node playbook. For more information, see "[Remove nodes](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/getting-started.md#remove-nodes)".
251+
You can add worker nodes from your cluster by running the scale playbook. For more information,
252+
see "[Adding nodes](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/getting-started.md#adding-nodes)".
253+
You can remove worker nodes from your cluster by running the remove-node playbook. For more information,
254+
see "[Remove nodes](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/getting-started.md#remove-nodes)".
232255
-->
233256
### 扩展集群 {#scale-your-cluster}
234257

@@ -240,7 +263,8 @@ You can remove worker nodes from your cluster by running the remove-node playboo
240263
<!--
241264
### Upgrade your cluster
242265
243-
You can upgrade your cluster by running the upgrade-cluster playbook. For more information, see "[Upgrades](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/upgrades.md)".
266+
You can upgrade your cluster by running the upgrade-cluster playbook. For more information,
267+
see "[Upgrades](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/upgrades.md)".
244268
-->
245269
### 升级集群 {#upgrade-your-cluster}
246270

@@ -250,7 +274,8 @@ You can upgrade your cluster by running the upgrade-cluster playbook. For more i
250274
<!--
251275
## Cleanup
252276
253-
You can reset your nodes and wipe out all components installed with Kubespray via the [reset playbook](https://github.com/kubernetes-sigs/kubespray/blob/master/reset.yml).
277+
You can reset your nodes and wipe out all components installed with Kubespray
278+
via the [reset playbook](https://github.com/kubernetes-sigs/kubespray/blob/master/reset.yml).
254279
-->
255280
## 清理 {#cleanup}
256281

@@ -267,7 +292,8 @@ When running the reset playbook, be sure not to accidentally target your product
267292
<!--
268293
## Feedback
269294
270-
* Slack Channel: [#kubespray](https://kubernetes.slack.com/messages/kubespray/) (You can get your invite [here](https://slack.k8s.io/)).
295+
* Slack Channel: [#kubespray](https://kubernetes.slack.com/messages/kubespray/)
296+
(You can get your invite [here](https://slack.k8s.io/)).
271297
* [GitHub Issues](https://github.com/kubernetes-sigs/kubespray/issues).
272298
-->
273299
## 反馈 {#feedback}
@@ -282,6 +308,6 @@ When running the reset playbook, be sure not to accidentally target your product
282308
* Check out planned work on Kubespray's [roadmap](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/roadmap.md).
283309
* Learn more about [Kubespray](https://github.com/kubernetes-sigs/kubespray).
284310
-->
285-
* 查看有关 Kubespray
311+
* 查看有关 Kubespray
286312
[路线图](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/roadmap.md)的计划工作。
287313
* 查阅有关 [Kubespray](https://github.com/kubernetes-sigs/kubespray) 的更多信息。

0 commit comments

Comments
 (0)