@@ -4,12 +4,6 @@ content_type: concept
4
4
weight : 20
5
5
---
6
6
7
- <!--
8
- title: kubeadm init
9
- content_type: concept
10
- weight: 20
11
- -->
12
-
13
7
<!-- overview -->
14
8
15
9
<!--
@@ -249,7 +243,7 @@ If your configuration is not using the latest version it is **recommended** that
249
243
the [kubeadm config migrate](/docs/reference/setup-tools/kubeadm/kubeadm-config/) command.
250
244
251
245
For more information on the fields and usage of the configuration you can navigate to our
252
- [API reference page](/docs/reference/config-api/kubeadm-config.v1beta3 /).
246
+ [API reference page](/docs/reference/config-api/kubeadm-config.v1beta4 /).
253
247
-->
254
248
可以使用 [ kubeadm config print] ( /zh-cn/docs/reference/setup-tools/kubeadm/kubeadm-config/ )
255
249
命令打印出默认配置。
@@ -258,7 +252,7 @@ For more information on the fields and usage of the configuration you can naviga
258
252
[ kubeadm config migrate] ( /zh-cn/docs/reference/setup-tools/kubeadm/kubeadm-config/ )
259
253
命令进行迁移。
260
254
261
- 关于配置的字段和用法的更多信息,你可以访问 [ API 参考页面] ( /zh-cn/docs/reference/config-api/kubeadm-config.v1beta3 / ) 。
255
+ 关于配置的字段和用法的更多信息,你可以访问 [ API 参考页面] ( /zh-cn/docs/reference/config-api/kubeadm-config.v1beta4 / ) 。
262
256
263
257
<!--
264
258
### Using kubeadm init with feature gates {#feature-gates}
@@ -276,12 +270,12 @@ Kubeadm 支持一组独有的特性门控,只能在 `kubeadm init` 创建集
276
270
<!--
277
271
To pass a feature gate you can either use the `--feature-gates` flag for
278
272
`kubeadm init`, or you can add items into the `featureGates` field when you pass
279
- a [configuration file](/docs/reference/config-api/kubeadm-config.v1beta3 /#kubeadm-k8s-io-v1beta3 -ClusterConfiguration)
273
+ a [configuration file](/docs/reference/config-api/kubeadm-config.v1beta4 /#kubeadm-k8s-io-v1beta4 -ClusterConfiguration)
280
274
using `--config`.
281
275
-->
282
276
你可以使用 ` --feature-gates ` 标志来为 ` kubeadm init ` 设置特性门控,
283
277
或者你可以在用 ` --config `
284
- 传递[ 配置文件] ( /zh-cn/docs/reference/config-api/kubeadm-config.v1beta3 /#kubeadm-k8s-io-v1beta3 -ClusterConfiguration ) 时添加条目到
278
+ 传递[ 配置文件] ( /zh-cn/docs/reference/config-api/kubeadm-config.v1beta4 /#kubeadm-k8s-io-v1beta4 -ClusterConfiguration ) 时添加条目到
285
279
` featureGates ` 字段中。
286
280
287
281
<!--
@@ -301,18 +295,18 @@ List of feature gates:
301
295
{{< table caption="kubeadm feature gates" >}}
302
296
Feature | Default | Alpha | Beta | GA
303
297
:-------|:--------|:------|:-----|:----
298
+ `ControlPlaneKubeletLocalMode` | `false` | 1.31 | - | -
304
299
`EtcdLearnerMode` | `true` | 1.27 | 1.29 | -
305
300
`PublicKeysECDSA` | `false` | 1.19 | - | -
306
- `RootlessControlPlane` | `false` | 1.22 | - | -
307
301
`WaitForAllControlPlaneComponents` | `false` | 1.30 | - | -
308
302
{{< /table >}}
309
303
-->
310
304
{{< table caption="kubeadm 特性门控" >}}
311
305
特性 | 默认值 | Alpha | Beta | GA
312
306
:-------|:--------|:------|:-----|:----
307
+ ` ControlPlaneKubeletLocalMode ` | ` false ` | 1.31 | - | -
313
308
` EtcdLearnerMode ` | ` true ` | 1.27 | 1.29 | -
314
309
` PublicKeysECDSA ` | ` false ` | 1.19 | - | -
315
- ` RootlessControlPlane ` | ` false ` | 1.22 | - | -
316
310
` WaitForAllControlPlaneComponents ` | ` false ` | 1.30 | - | -
317
311
{{< /table >}}
318
312
@@ -328,6 +322,17 @@ Feature gate descriptions:
328
322
-->
329
323
特性门控的描述:
330
324
325
+ <!--
326
+ `ControlPlaneKubeletLocalMode`
327
+ : With this feature gate enabled, when joining a new control plane node, kubeadm will configure the kubelet
328
+ to connect to the local kube-apiserver. This ensures that there will not be a violation of the version skew
329
+ policy during rolling upgrades.
330
+ -->
331
+ ` ControlPlaneKubeletLocalMode `
332
+ : 启用此特性门控后,当加入新的控制平面节点时,
333
+ kubeadm 将配置 kubelet 连接到本地 kube-apiserver。
334
+ 这将确保在滚动升级期间不会违反版本偏差策略。
335
+
331
336
<!--
332
337
`EtcdLearnerMode`
333
338
: With this feature gate enabled, when joining a new control plane node, a new etcd member will be created
@@ -343,27 +348,17 @@ as a learner and promoted to a voting member only after the etcd data are fully
343
348
Renewal of existing ECDSA certificates is also supported using `kubeadm certs renew`, but you cannot
344
349
switch between the RSA and ECDSA algorithms on the fly or during upgrades. Kubernetes
345
350
{{< skew currentVersion >}} has a bug where keys in generated kubeconfig files are set use RSA
346
- despite the feature gate being enabled.
351
+ despite the feature gate being enabled. Kubernetes versions before v1.31 had a bug where keys in generated kubeconfig files
352
+ were set use RSA, even when you had enabled the `PublicKeysECDSA` feature gate.
347
353
-->
348
354
` PublicKeysECDSA `
349
355
: 可用于创建集群时使用 ECDSA 证书而不是默认 RSA 算法。
350
356
支持用 ` kubeadm certs renew ` 更新现有 ECDSA 证书,
351
357
但你不能在集群运行期间或升级期间切换 RSA 和 ECDSA 算法。
352
- Kubernetes {{< skew currentVersion >}} 有一个错误,尽管开启了特性门控,
358
+ Kubernetes {{< skew currentVersion >}} 有一个错误,尽管开启了特性门控,
353
359
所生成的 kubeconfig 文件中的密钥仍使用 RSA 设置。
354
-
355
- <!--
356
- `RootlessControlPlane`
357
- : Setting this flag configures the kubeadm deployed control plane component static Pod containers
358
- for `kube-apiserver`, `kube-controller-manager`, `kube-scheduler` and `etcd` to run as non-root users.
359
- If the flag is not set, those components run as root. You can change the value of this feature gate before
360
- you upgrade to a newer version of Kubernetes.
361
- -->
362
- ` RootlessControlPlane `
363
- : 设置此标志来配置 kubeadm 所部署的控制平面组件中的静态 Pod 容器
364
- ` kube-apiserver ` 、` kube-controller-manager ` 、` kube-scheduler ` 和 ` etcd `
365
- 以非 root 用户身份运行。如果未设置该标志,则这些组件以 root 身份运行。
366
- 你可以在升级到更新版本的 Kubernetes 之前更改此特性门控的值。
360
+ 在 v1.31 之前的 Kubernetes 版本中,即使启用了 ` PublicKeysECDSA ` 特性门控,
361
+ 所生成的 kubeconfig 文件中的密钥仍然被设置为使用 RSA。
367
362
368
363
<!--
369
364
`WaitForAllControlPlaneComponents`
@@ -392,15 +387,15 @@ List of deprecated feature gates:
392
387
393
388
<!--
394
389
{{< table caption="kubeadm deprecated feature gates" >}}
395
- Feature | Default
396
- :-------|:--------
397
- `UpgradeAddonsBeforeControlPlane ` | `false`
390
+ Feature | Default | Alpha | Beta | GA | Deprecated
391
+ :-------|:--------|:------|:-----|:---|:----------
392
+ `RootlessControlPlane ` | `false` | 1.22 | - | - | 1.31
398
393
{{< /table >}}
399
394
-->
400
395
{{< table caption="kubeadm 弃用的特性门控" >}}
401
- 特性 | 默认值
402
- :-------|:--------
403
- ` UpgradeAddonsBeforeControlPlane ` | ` false `
396
+ 特性 | 默认值 | Alpha | Beta | GA | 弃用
397
+ :-------|:--------|:------|:-----|:---|:----------
398
+ ` RootlessControlPlane ` | ` false ` | 1.22 | - | - | 1.31
404
399
{{< /table >}}
405
400
406
401
<!--
@@ -409,40 +404,17 @@ Feature gate descriptions:
409
404
特性门控描述:
410
405
411
406
<!--
412
- `UpgradeAddonsBeforeControlPlane`
413
- : This is as a **disabled** feature gate that was introduced for Kubernetes v1.28,
414
- in order to allow reactivating a legacy and deprecated behavior during cluster upgrade.
415
- For kubeadm versions prior to v1.28, kubeadm upgrades cluster addons
416
- (including CoreDNS and kube-proxy) immediately during `kubeadm upgrade apply`,
417
- regardless of whether there are other control plane instances that have not been upgraded.
418
- This may cause compatibility problems. Since v1.28, kubeadm defaults to a mode that
419
- always checks whether all the control plane instances have been upgraded before starting
420
- to upgrade the addons. This behavior is applied to both `kubeadm upgrade apply` and
421
- `kubeadm upgrade node`. kubeadm determines whether a control plane instance
422
- has been upgraded by checking whether the image of the kube-apiserver Pod has
423
- been upgraded. You must perform control plane instances upgrade sequentially or
424
- at least ensure that the last control plane instance upgrade is not started until
425
- all the other control plane instances have been upgraded completely, and the addons
426
- upgrade will be performed after the last control plane instance is upgraded.
427
- The deprecated `UpgradeAddonsBeforeControlPlane` feature gate gives you a chance
428
- to keep the old upgrade behavior. You should not need this old behavior; if you do,
429
- you should consider changing your cluster or upgrade processes, as this
430
- feature gate will be removed in a future release.
407
+ `RootlessControlPlane`
408
+ : Setting this flag configures the kubeadm deployed control plane component static Pod containers
409
+ for `kube-apiserver`, `kube-controller-manager`, `kube-scheduler` and `etcd` to run as non-root users.
410
+ If the flag is not set, those components run as root. You can change the value of this feature gate before
411
+ you upgrade to a newer version of Kubernetes.
431
412
-->
432
- ` UpgradeAddonsBeforeControlPlane `
433
- : 这是一个在 Kubernetes v1.28 中引入的默认** 禁用** 的特性门控,
434
- 目的是在集群升级期间允许重新激活旧版且已弃用的行为。对于早于 v1.28 的 kubeadm 版本,
435
- 在 ` kubeadm upgrade apply ` 期间会立即升级集群插件(包括 CoreDNS 和 kube-proxy),
436
- 而不管是否有其他未升级的控制平面实例。这可能导致兼容性问题。从 v1.28 开始,
437
- kubeadm 默认采用的模式是在开始升级插件之前始终检查是否所有控制平面实例都已完成升级。
438
- 此行为适用于 ` kubeadm upgrade apply ` 和 ` kubeadm upgrade node ` 。
439
- kubeadm 通过检查 kube-apiserver Pod 的镜像来确定控制平面实例是否已升级。
440
- 你必须按顺序执行控制平面实例的升级,
441
- 或者至少确保在所有其他控制平面实例完全升级之前不启动最后一个控制平面实例的升级,
442
- 并且在最后一个控制平面实例升级完成后再执行插件的升级。
443
- 这个弃用的 ` UpgradeAddonsBeforeControlPlane ` 特性门控使你有机会保留旧的升级行为。
444
- 你不应该需要这种旧的行为;如果确实需要,请考虑更改集群或升级流程,
445
- 因为此特性门控将在未来的版本中被移除。
413
+ ` RootlessControlPlane `
414
+ : 设置此标志来配置 kubeadm 所部署的控制平面组件中的静态 Pod 容器
415
+ ` kube-apiserver ` 、` kube-controller-manager ` 、` kube-scheduler ` 和 ` etcd `
416
+ 以非 root 用户身份运行。如果未设置该标志,则这些组件以 root 身份运行。
417
+ 你可以在升级到更新版本的 Kubernetes 之前更改此特性门控的值。
446
418
447
419
<!--
448
420
List of removed feature gates:
@@ -455,13 +427,15 @@ Feature | Alpha | Beta | GA | Removed
455
427
:-------|:------|:-----|:---|:-------
456
428
`IPv6DualStack` | 1.16 | 1.21 | 1.23 | 1.24
457
429
`UnversionedKubeletConfigMap` | 1.22 | 1.23 | 1.25 | 1.26
430
+ `UpgradeAddonsBeforeControlPlane` | 1.28 | - | - | 1.31
458
431
{{< /table >}}
459
432
-->
460
433
{{< table caption="kubeadm 已移除的特性门控" >}}
461
434
特性 | Alpha | Beta | GA | 移除
462
435
:-------|:------|:-----|:---|:-------
463
436
` IPv6DualStack ` | 1.16 | 1.21 | 1.23 | 1.24
464
437
` UnversionedKubeletConfigMap ` | 1.22 | 1.23 | 1.25 | 1.26
438
+ ` UpgradeAddonsBeforeControlPlane ` | 1.28 | - | - | 1.31
465
439
{{< /table >}}
466
440
467
441
<!--
@@ -501,6 +475,14 @@ if that does not succeed, kubeadm falls back to using the legacy (versioned) nam
501
475
kubeadm 尝试首先使用无版本(后缀)的 ConfigMap 名称;
502
476
如果不成功,kubeadm 将回退到使用该 ConfigMap 的旧(带版本号的)名称。
503
477
478
+ <!--
479
+ `UpgradeAddonsBeforeControlPlane`
480
+ : This feature gate has been removed. It was introduced in v1.28 as a deprecated feature and then removed in v1.31. For documentation on older versions, please switch to the corresponding website version.
481
+ -->
482
+ ` UpgradeAddonsBeforeControlPlane `
483
+ : 此特性门控已被移除。它在 v1.28 中作为一个已弃用的特性被引入,在 v1.31 中被移除。
484
+ 有关旧版本的文档,请切换到相应的网站版本。
485
+
504
486
<!--
505
487
### Adding kube-proxy parameters {#kube-proxy}
506
488
@@ -661,13 +643,14 @@ The following phase command can be used to re-upload the certificates after expi
661
643
``` shell
662
644
kubeadm init phase upload-certs --upload-certs --config=SOME_YAML_FILE
663
645
```
646
+
664
647
{{< note >}}
665
648
<!--
666
649
A predefined `certificateKey` can be provided in `InitConfiguration` when passing the
667
- [configuration file](/docs/reference/config-api/kubeadm-config.v1beta3 /) with `--config`.
650
+ [configuration file](/docs/reference/config-api/kubeadm-config.v1beta4 /) with `--config`.
668
651
-->
669
652
在使用 ` --config `
670
- 传递[ 配置文件] ( /zh-cn/docs/reference/config-api/kubeadm-config.v1beta3 / ) 时,
653
+ 传递[ 配置文件] ( /zh-cn/docs/reference/config-api/kubeadm-config.v1beta4 / ) 时,
671
654
可以在 ` InitConfiguration ` 中提供预定义的 ` certificateKey ` 。
672
655
{{< /note >}}
673
656
0 commit comments