@@ -124,9 +124,13 @@ Any commands under `kubeadm alpha` are, by definition, supported on an alpha lev
124
124
125
125
<!--
126
126
### Preparing the hosts
127
+
128
+ #### Component installation
127
129
-->
128
130
### 主机准备 {#preparing-the-hosts}
129
131
132
+ #### 安装组件 {#component-installation}
133
+
130
134
<!--
131
135
Install a {{< glossary_tooltip term_id="container-runtime" text="container runtime" >}} and kubeadm on all the hosts.
132
136
For detailed instructions and other prerequisites, see [Installing kubeadm](/docs/setup/production-environment/tools/kubeadm/install-kubeadm/).
@@ -152,6 +156,110 @@ After you initialize your control-plane, the kubelet runs normally.
152
156
初始化控制平面后,kubelet 将正常运行。
153
157
{{< /note >}}
154
158
159
+ <!--
160
+ #### Network setup
161
+
162
+ kubeadm similarly to other Kubernetes components tries to find a usable IP on
163
+ the network interface associated with the default gateway on a host. Such
164
+ an IP is then used for the advertising and/or listening performed by a component.
165
+ -->
166
+ #### 网络设置 {#network-setup}
167
+
168
+ kubeadm 与其他 Kubernetes 组件类似,会尝试在与主机默认网关关联的网络接口上找到可用的 IP 地址。
169
+ 这个 IP 地址随后用于由某组件执行的公告和/或监听。
170
+
171
+ <!--
172
+ To find out what this IP is on a Linux host you can use:
173
+
174
+ ```shell
175
+ ip route show # Look for a line starting with "default via"
176
+ ```
177
+ -->
178
+ 要在 Linux 主机上获得此 IP 地址,你可以使用以下命令:
179
+
180
+ ``` shell
181
+ ip route show # 查找以 "default via" 开头的行
182
+ ```
183
+
184
+ <!--
185
+ Kubernetes components do not accept custom network interface as an option,
186
+ therefore a custom IP address must be passed as a flag to all components instances
187
+ that need such a custom configuration.
188
+
189
+ To configure the API server advertise address for control plane nodes created with both
190
+ `init` and `join`, the flag `--apiserver-advertise-address` can be used.
191
+ Preferably, this option can be set in the [kubeadm API](/docs/reference/config-api/kubeadm-config.v1beta3)
192
+ as `InitConfiguration.localAPIEndpoint` and `JoinConfiguration.controlPlane.localAPIEndpoint`.
193
+ -->
194
+ Kubernetes 组件不接受自定义网络接口作为选项,因此必须将自定义 IP
195
+ 地址作为标志传递给所有需要此自定义配置的组件实例。
196
+
197
+ 要为使用 ` init ` 或 ` join ` 创建的控制平面节点配置 API 服务器的公告地址,
198
+ 你可以使用 ` --apiserver-advertise-address ` 标志。
199
+ 最好在 [ kubeadm API] ( /zh-cn/docs/reference/config-api/kubeadm-config.v1beta3 ) 中使用
200
+ ` InitConfiguration.localAPIEndpoint ` 和 ` JoinConfiguration.controlPlane.localAPIEndpoint `
201
+ 来设置此选项。
202
+
203
+ <!--
204
+ For kubelets on all nodes, the `--node-ip` option can be passed in
205
+ `.nodeRegistration.kubeletExtraArgs` inside a kubeadm configuration file
206
+ (`InitConfiguration` or `JoinConfiguration`).
207
+
208
+ For dual-stack see
209
+ [Dual-stack support with kubeadm](/docs/setup/production-environment/tools/kubeadm/dual-stack-support).
210
+ -->
211
+ 对于所有节点上的 kubelet,` --node-ip ` 选项可以在 kubeadm 配置文件
212
+ (` InitConfiguration ` 或 ` JoinConfiguration ` )的 ` .nodeRegistration.kubeletExtraArgs `
213
+ 中设置。
214
+
215
+ 有关双协议栈细节参见[ 使用 kubeadm 支持双协议栈] ( /zh-cn/docs/setup/production-environment/tools/kubeadm/dual-stack-support ) 。
216
+
217
+ {{< note >}}
218
+ <!--
219
+ IP addresses become part of certificates SAN fields. Changing these IP addresses would require
220
+ signing new certificates and restarting the affected components, so that the change in
221
+ certificate files is reflected. See
222
+ [Manual certificate renewal](/docs/tasks/administer-cluster/kubeadm/kubeadm-certs/#manual-certificate-renewal)
223
+ for more details on this topic.
224
+ -->
225
+ IP 地址成为证书 SAN 字段的一部分。更改这些 IP 地址将需要签署新的证书并重启受影响的组件,
226
+ 以便反映证书文件中的变化。有关此主题的更多细节参见
227
+ [ 手动续期证书] ( /zh-cn/docs/tasks/administer-cluster/kubeadm/kubeadm-certs/#manual-certificate-renewal ) 。
228
+ {{</ note >}}
229
+
230
+ {{< warning >}}
231
+ <!--
232
+ The Kubernetes project recommends against this approach (configuring all component instances
233
+ with custom IP addresses). Instead, the Kubernetes maintainers recommend to setup the host network,
234
+ so that the default gateway IP is the one that Kubernetes components auto-detect and use.
235
+ On Linux nodes, you can use commands such as `ip route` to configure networking; your operating
236
+ system might also provide higher level network management tools. If your node's default gateway
237
+ is a public IP address, you should configure packet filtering or other security measures that
238
+ protect the nodes and your cluster.
239
+ -->
240
+ Kubernetes 项目不推荐此方法(使用自定义 IP 地址配置所有组件实例)。
241
+ Kubernetes 维护者建议设置主机网络,使默认网关 IP 成为 Kubernetes 组件自动检测和使用的 IP。
242
+ 对于 Linux 节点,你可以使用诸如 ` ip route ` 的命令来配置网络;
243
+ 你的操作系统可能还提供更高级的网络管理工具。
244
+ 如果节点的默认网关是公共 IP 地址,你应配置数据包过滤或其他保护节点和集群的安全措施。
245
+ {{< /warning >}}
246
+
247
+ {{< note >}}
248
+ <!--
249
+ If the host does not have a default gateway, it is recommended to setup one. Otherwise,
250
+ without passing a custom IP address to a Kubernetes component, the component
251
+ will exit with an error. If two or more default gateways are present on the host,
252
+ a Kubernetes component will try to use the first one it encounters that has a suitable
253
+ global unicast IP address. While making this choice, the exact ordering of gateways
254
+ might vary between different operating systems and kernel versions.
255
+ -->
256
+ 如果主机没有默认网关,则建议设置一个默认网关。
257
+ 否则,在不传递自定义 IP 地址给 Kubernetes 组件的情况下,此组件将退出并报错。
258
+ 如果主机上存在两个或多个默认网关,则 Kubernetes
259
+ 组件将尝试使用所遇到的第一个具有合适全局单播 IP 地址的网关。
260
+ 在做出此选择时,网关的确切顺序可能因不同的操作系统和内核版本而有所差异。
261
+ {{< /note >}}
262
+
155
263
<!--
156
264
### Preparing the required container images
157
265
-->
@@ -209,7 +317,7 @@ a provider-specific value. See [Installing a Pod network add-on](#pod-network).
209
317
1 . (推荐)如果计划将单个控制平面 kubeadm 集群升级成高可用,
210
318
你应该指定 ` --control-plane-endpoint ` 为所有控制平面节点设置共享端点。
211
319
端点可以是负载均衡器的 DNS 名称或 IP 地址。
212
- 1 . 选择一个 Pod 网络插件,并验证是否需要为 ` kubeadm init ` 传递参数。
320
+ 2 . 选择一个 Pod 网络插件,并验证是否需要为 ` kubeadm init ` 传递参数。
213
321
根据你选择的第三方网络插件,你可能需要设置 ` --pod-network-cidr ` 的值。
214
322
请参阅[ 安装 Pod 网络附加组件] ( #pod-network ) 。
215
323
@@ -218,19 +326,10 @@ a provider-specific value. See [Installing a Pod network add-on](#pod-network).
218
326
known endpoints. To use different container runtime or if there are more than one installed
219
327
on the provisioned node, specify the `--cri-socket` argument to `kubeadm`. See
220
328
[Installing a runtime](/docs/setup/production-environment/tools/kubeadm/install-kubeadm/#installing-runtime).
221
- 1. (Optional) Unless otherwise specified, `kubeadm` uses the network interface associated
222
- with the default gateway to set the advertise address for this particular control-plane node's API server.
223
- To use a different network interface, specify the `--apiserver-advertise-address=<ip-address>` argument
224
- to `kubeadm init`. To deploy an IPv6 Kubernetes cluster using IPv6 addressing, you
225
- must specify an IPv6 address, for example `--apiserver-advertise-address=2001:db8::101`
226
329
-->
227
- 1 . (可选)` kubeadm ` 试图通过使用已知的端点列表来检测容器运行时。
330
+ 3 . (可选)` kubeadm ` 试图通过使用已知的端点列表来检测容器运行时。
228
331
使用不同的容器运行时或在预配置的节点上安装了多个容器运行时,请为 ` kubeadm init ` 指定 ` --cri-socket ` 参数。
229
332
请参阅[ 安装运行时] ( /zh-cn/docs/setup/production-environment/tools/kubeadm/install-kubeadm/#installing-runtime ) 。
230
- 1 . (可选)除非另有说明,否则 ` kubeadm ` 使用与默认网关关联的网络接口来设置此控制平面节点 API server 的广播地址。
231
- 要使用其他网络接口,请为 ` kubeadm init ` 设置 ` --apiserver-advertise-address=<ip-address> ` 参数。
232
- 要部署使用 IPv6 地址的 Kubernetes 集群,
233
- 必须指定一个 IPv6 地址,例如 ` --apiserver-advertise-address=2001:db8::101 ` 。
234
333
235
334
<!--
236
335
To initialize the control-plane node run:
0 commit comments