@@ -3,7 +3,6 @@ title: kubeadm init
3
3
content_type : concept
4
4
weight : 20
5
5
---
6
-
7
6
<!--
8
7
reviewers:
9
8
- luxas
@@ -133,7 +132,7 @@ following steps:
133
132
Please note that although the DNS server is deployed, it will not be scheduled until CNI is installed.
134
133
-->
135
134
8 . 通过 API 服务器安装一个 DNS 服务器 (CoreDNS) 和 kube-proxy 附加组件。
136
- 在 Kubernetes 版本 1 .11 和更高版本中,CoreDNS 是默认的 DNS 服务器。
135
+ 在 Kubernetes v1 .11 和更高版本中,CoreDNS 是默认的 DNS 服务器。
137
136
请注意,尽管已部署 DNS 服务器,但直到安装 CNI 时才调度它。
138
137
139
138
{{< warning >}}
@@ -148,7 +147,6 @@ following steps:
148
147
149
148
Kubeadm allows you to create a control-plane node in phases using the `kubeadm init phase` command.
150
149
-->
151
-
152
150
### 在 kubeadm 中使用 init 阶段 {#init-phases}
153
151
154
152
Kubeadm 允许你使用 ` kubeadm init phase ` 命令分阶段创建控制平面节点。
@@ -228,7 +226,7 @@ Alternatively, you can use the `skipPhases` field under `InitConfiguration`.
228
226
<!--
229
227
The config file is still considered beta and may change in future versions.
230
228
-->
231
- 配置文件的功能仍然处于 beta 状态并且在将来的版本中可能会改变。
229
+ 配置文件的功能仍然处于 Beta 状态并且在将来的版本中可能会改变。
232
230
{{< /caution >}}
233
231
234
232
<!--
@@ -299,6 +297,15 @@ List of feature gates:
299
297
-->
300
298
特性门控的列表:
301
299
300
+ <!--
301
+ {{< table caption="kubeadm feature gates" >}}
302
+ Feature | Default | Alpha | Beta | GA
303
+ :-------|:--------|:------|:-----|:----
304
+ `PublicKeysECDSA` | `false` | 1.19 | - | -
305
+ `RootlessControlPlane` | `false` | 1.22 | - | -
306
+ `UnversionedKubeletConfigMap` | `true` | 1.22 | 1.23 | 1.25
307
+ {{< /table >}}
308
+ -->
302
309
{{< table caption="kubeadm 特性门控" >}}
303
310
特性 | 默认值 | Alpha | Beta | GA
304
311
:-------|:--------|:------|:-----|:----
@@ -327,8 +334,8 @@ switch between the RSA and ECDSA algorithms on the fly or during upgrades.
327
334
-->
328
335
` PublicKeysECDSA `
329
336
: 可用于创建集群时使用 ECDSA 证书而不是默认 RSA 算法。
330
- 支持用 ` kubeadm certs renew ` 更新现有 ECDSA 证书,
331
- 但你不能在集群运行期间或升级期间切换 RSA 和 ECDSA 算法。
337
+ 支持用 ` kubeadm certs renew ` 更新现有 ECDSA 证书,
338
+ 但你不能在集群运行期间或升级期间切换 RSA 和 ECDSA 算法。
332
339
333
340
<!--
334
341
`RootlessControlPlane`
@@ -339,9 +346,9 @@ you upgrade to a newer version of Kubernetes.
339
346
-->
340
347
` RootlessControlPlane `
341
348
: 设置此标志来配置 kubeadm 所部署的控制平面组件中的静态 Pod 容器
342
- ` kube-apiserver ` 、` kube-controller-manager ` 、` kube-scheduler ` 和 ` etcd ` 以非 root 用户身份运行。
343
- 如果未设置该标志,则这些组件以 root 身份运行。
344
- 你可以在升级到更新版本的 Kubernetes 之前更改此特性门控的值。
349
+ ` kube-apiserver ` 、` kube-controller-manager ` 、` kube-scheduler ` 和 ` etcd ` 以非 root 用户身份运行。
350
+ 如果未设置该标志,则这些组件以 root 身份运行。
351
+ 你可以在升级到更新版本的 Kubernetes 之前更改此特性门控的值。
345
352
346
353
<!--
347
354
`UnversionedKubeletConfigMap`
@@ -356,14 +363,74 @@ if that does not succeed, kubeadm falls back to using the legacy (versioned) nam
356
363
-->
357
364
` UnversionedKubeletConfigMap `
358
365
: 此标志控制 kubeadm 存储 kubelet 配置数据的 {{<glossary_tooltip text="ConfigMap" term_id="configmap" >}} 的名称。
359
- 在未指定此标志或设置为 ` true ` 的情况下,此 ConfigMap 被命名为 ` kubelet-config ` 。
360
- 如果将此标志设置为 ` false ` ,则此 ConfigMap 的名称会包括 Kubernetes 的主要版本和次要版本(例如:` kubelet-config-{{< skew currentVersion >}} ` )。
361
- Kubeadm 会确保用于读写 ConfigMap 的 RBAC 规则适合你设置的值。
362
- 当 kubeadm 写入此 ConfigMap 时(在 ` kubeadm init ` 或 ` kubeadm upgrade apply ` 期间),
363
- kubeadm 根据 ` UnversionedKubeletConfigMap ` 的设置值来执行操作。
364
- 当读取此 ConfigMap 时(在 ` kubeadm join ` 、` kubeadm reset ` 、` kubeadm upgrade ... ` 期间),
365
- kubeadm 尝试首先使用无版本(后缀)的 ConfigMap 名称;
366
- 如果不成功,kubeadm 将回退到使用该 ConfigMap 的旧(带版本号的)名称。
366
+ 在未指定此标志或设置为 ` true ` 的情况下,此 ConfigMap 被命名为 ` kubelet-config ` 。
367
+ 如果将此标志设置为 ` false ` ,则此 ConfigMap 的名称会包括 Kubernetes 的主要版本和次要版本
368
+ (例如:` kubelet-config-{{< skew currentVersion >}} ` )。
369
+ kubeadm 会确保用于读写 ConfigMap 的 RBAC 规则适合你设置的值。
370
+ 当 kubeadm 写入此 ConfigMap 时(在 ` kubeadm init ` 或 ` kubeadm upgrade apply ` 期间),
371
+ kubeadm 根据 ` UnversionedKubeletConfigMap ` 的设置值来执行操作。
372
+ 当读取此 ConfigMap 时(在 ` kubeadm join ` 、` kubeadm reset ` 、` kubeadm upgrade ... ` 期间),
373
+ kubeadm 尝试首先使用无版本(后缀)的 ConfigMap 名称;
374
+ 如果不成功,kubeadm 将回退到使用该 ConfigMap 的旧(带版本号的)名称。
375
+
376
+ <!--
377
+ List of deprecated feature gates:
378
+ -->
379
+ 已弃用特性门控的列表:
380
+
381
+ <!--
382
+ {{< table caption="kubeadm deprecated feature gates" >}}
383
+ Feature | Default
384
+ :-------|:--------
385
+ `UpgradeAddonsBeforeControlPlane` | `false`
386
+ {{< /table >}}
387
+ -->
388
+ {{< table caption="kubeadm 弃用的特性门控" >}}
389
+ 特性 | 默认值
390
+ :-------|:--------
391
+ ` UpgradeAddonsBeforeControlPlane ` | ` false `
392
+ {{< /table >}}
393
+
394
+ <!--
395
+ Feature gate descriptions:
396
+ -->
397
+ 特性门控描述:
398
+
399
+ <!--
400
+ `UpgradeAddonsBeforeControlPlane`
401
+ : This is as a **disabled** feature gate that was introduced for Kubernetes v1.28,
402
+ in order to allow reactivating a legacy and deprecated behavior during cluster upgrade.
403
+ For kubeadm versions prior to v1.28, kubeadm upgrades cluster addons
404
+ (including CoreDNS and kube-proxy) immediately during `kubeadm upgrade apply`,
405
+ regardless of whether there are other control plane instances that have not been upgraded.
406
+ This may cause compatibility problems. Since v1.28, kubeadm defaults to a mode that
407
+ always checks whether all the control plane instances have been upgraded before starting
408
+ to upgrade the addons. This behavior is applied to both `kubeadm upgrade apply` and
409
+ `kubeadm upgrade node`. kubeadm determines whether a control plane instance
410
+ has been upgraded by checking whether the image of the kube-apiserver Pod has
411
+ been upgraded. You must perform control plane instances upgrade sequentially or
412
+ at least ensure that the last control plane instance upgrade is not started until
413
+ all the other control plane instances have been upgraded completely, and the addons
414
+ upgrade will be performed after the last control plane instance is upgraded.
415
+ The deprecated `UpgradeAddonsBeforeControlPlane` feature gate gives you a chance
416
+ to keep the old upgrade behavior. You should not need this old behavior; if you do,
417
+ you should consider changing your cluster or upgrade processes, as this
418
+ feature gate will be removed in a future release.
419
+ -->
420
+ ` UpgradeAddonsBeforeControlPlane `
421
+ : 这是一个在 Kubernetes v1.28 中引入的默认禁用的特性门控,
422
+ 目的是在集群升级期间允许重新激活旧版且已弃用的行为。对于早于 v1.28 的 kubeadm 版本,
423
+ 在 ` kubeadm upgrade apply ` 期间会立即升级集群插件(包括 CoreDNS 和 kube-proxy),
424
+ 而不管是否有其他未升级的控制平面实例。这可能导致兼容性问题。从 v1.28 开始,
425
+ kubeadm 默认采用的模式是在开始升级插件之前始终检查是否所有控制平面实例都已完成升级。
426
+ 此行为适用于 ` kubeadm upgrade apply ` 和 ` kubeadm upgrade node ` 。
427
+ kubeadm 通过检查 kube-apiserver Pod 的镜像来确定控制平面实例是否已升级。
428
+ 你必须按顺序执行控制平面实例的升级,
429
+ 或者至少确保在所有其他控制平面实例完全升级之前不启动最后一个控制平面实例的升级,
430
+ 并且在最后一个控制平面实例升级完成后再执行插件的升级。
431
+ 这个弃用的 ` UpgradeAddonsBeforeControlPlane ` 特性门控使你有机会保留旧的升级行为。
432
+ 你不应该需要这种旧的行为;如果确实需要,请考虑更改集群或升级流程,
433
+ 因为此特性门控将在未来的版本中被移除。
367
434
368
435
<!--
369
436
### Adding kube-proxy parameters {#kube-proxy}
0 commit comments