Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 427d578

Browse files
authoredAug 16, 2024
Merge pull request kubernetes#47495 from windsonsea/inityh
[zh] Sync kubeadm/kubeadm-init.md
2 parents 709795e + b684984 commit 427d578

File tree

1 file changed

+51
-68
lines changed

1 file changed

+51
-68
lines changed
 

‎content/zh-cn/docs/reference/setup-tools/kubeadm/kubeadm-init.md

+51-68
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ content_type: concept
44
weight: 20
55
---
66

7-
<!--
8-
title: kubeadm init
9-
content_type: concept
10-
weight: 20
11-
-->
12-
137
<!-- overview -->
148

159
<!--
@@ -249,7 +243,7 @@ If your configuration is not using the latest version it is **recommended** that
249243
the [kubeadm config migrate](/docs/reference/setup-tools/kubeadm/kubeadm-config/) command.
250244
251245
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/).
253247
-->
254248
可以使用 [kubeadm config print](/zh-cn/docs/reference/setup-tools/kubeadm/kubeadm-config/)
255249
命令打印出默认配置。
@@ -258,7 +252,7 @@ For more information on the fields and usage of the configuration you can naviga
258252
[kubeadm config migrate](/zh-cn/docs/reference/setup-tools/kubeadm/kubeadm-config/)
259253
命令进行迁移。
260254

261-
关于配置的字段和用法的更多信息,你可以访问 [API 参考页面](/zh-cn/docs/reference/config-api/kubeadm-config.v1beta3/)
255+
关于配置的字段和用法的更多信息,你可以访问 [API 参考页面](/zh-cn/docs/reference/config-api/kubeadm-config.v1beta4/)
262256

263257
<!--
264258
### Using kubeadm init with feature gates {#feature-gates}
@@ -276,12 +270,12 @@ Kubeadm 支持一组独有的特性门控,只能在 `kubeadm init` 创建集
276270
<!--
277271
To pass a feature gate you can either use the `--feature-gates` flag for
278272
`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)
280274
using `--config`.
281275
-->
282276
你可以使用 `--feature-gates` 标志来为 `kubeadm init` 设置特性门控,
283277
或者你可以在用 `--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)时添加条目到
285279
`featureGates` 字段中。
286280

287281
<!--
@@ -301,18 +295,18 @@ List of feature gates:
301295
{{< table caption="kubeadm feature gates" >}}
302296
Feature | Default | Alpha | Beta | GA
303297
:-------|:--------|:------|:-----|:----
298+
`ControlPlaneKubeletLocalMode` | `false` | 1.31 | - | -
304299
`EtcdLearnerMode` | `true` | 1.27 | 1.29 | -
305300
`PublicKeysECDSA` | `false` | 1.19 | - | -
306-
`RootlessControlPlane` | `false` | 1.22 | - | -
307301
`WaitForAllControlPlaneComponents` | `false` | 1.30 | - | -
308302
{{< /table >}}
309303
-->
310304
{{< table caption="kubeadm 特性门控" >}}
311305
特性 | 默认值 | Alpha | Beta | GA
312306
:-------|:--------|:------|:-----|:----
307+
`ControlPlaneKubeletLocalMode` | `false` | 1.31 | - | -
313308
`EtcdLearnerMode` | `true` | 1.27 | 1.29 | -
314309
`PublicKeysECDSA` | `false` | 1.19 | - | -
315-
`RootlessControlPlane` | `false` | 1.22 | - | -
316310
`WaitForAllControlPlaneComponents` | `false` | 1.30 | - | -
317311
{{< /table >}}
318312

@@ -328,6 +322,17 @@ Feature gate descriptions:
328322
-->
329323
特性门控的描述:
330324

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+
331336
<!--
332337
`EtcdLearnerMode`
333338
: 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
343348
Renewal of existing ECDSA certificates is also supported using `kubeadm certs renew`, but you cannot
344349
switch between the RSA and ECDSA algorithms on the fly or during upgrades. Kubernetes
345350
{{< 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.
347353
-->
348354
`PublicKeysECDSA`
349355
: 可用于创建集群时使用 ECDSA 证书而不是默认 RSA 算法。
350356
支持用 `kubeadm certs renew` 更新现有 ECDSA 证书,
351357
但你不能在集群运行期间或升级期间切换 RSA 和 ECDSA 算法。
352-
Kubernetes {{< skew currentVersion >}} 有一个错误,尽管开启了特性门控,
358+
Kubernetes {{< skew currentVersion >}} 有一个错误,尽管开启了特性门控,
353359
所生成的 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。
367362

368363
<!--
369364
`WaitForAllControlPlaneComponents`
@@ -392,15 +387,15 @@ List of deprecated feature gates:
392387

393388
<!--
394389
{{< 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
398393
{{< /table >}}
399394
-->
400395
{{< table caption="kubeadm 弃用的特性门控" >}}
401-
特性 | 默认值
402-
:-------|:--------
403-
`UpgradeAddonsBeforeControlPlane` | `false`
396+
特性 | 默认值 | Alpha | Beta | GA | 弃用
397+
:-------|:--------|:------|:-----|:---|:----------
398+
`RootlessControlPlane` | `false` | 1.22 | - | - | 1.31
404399
{{< /table >}}
405400

406401
<!--
@@ -409,40 +404,17 @@ Feature gate descriptions:
409404
特性门控描述:
410405

411406
<!--
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.
431412
-->
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 之前更改此特性门控的值。
446418

447419
<!--
448420
List of removed feature gates:
@@ -455,13 +427,15 @@ Feature | Alpha | Beta | GA | Removed
455427
:-------|:------|:-----|:---|:-------
456428
`IPv6DualStack` | 1.16 | 1.21 | 1.23 | 1.24
457429
`UnversionedKubeletConfigMap` | 1.22 | 1.23 | 1.25 | 1.26
430+
`UpgradeAddonsBeforeControlPlane` | 1.28 | - | - | 1.31
458431
{{< /table >}}
459432
-->
460433
{{< table caption="kubeadm 已移除的特性门控" >}}
461434
特性 | Alpha | Beta | GA | 移除
462435
:-------|:------|:-----|:---|:-------
463436
`IPv6DualStack` | 1.16 | 1.21 | 1.23 | 1.24
464437
`UnversionedKubeletConfigMap` | 1.22 | 1.23 | 1.25 | 1.26
438+
`UpgradeAddonsBeforeControlPlane` | 1.28 | - | - | 1.31
465439
{{< /table >}}
466440

467441
<!--
@@ -501,6 +475,14 @@ if that does not succeed, kubeadm falls back to using the legacy (versioned) nam
501475
kubeadm 尝试首先使用无版本(后缀)的 ConfigMap 名称;
502476
如果不成功,kubeadm 将回退到使用该 ConfigMap 的旧(带版本号的)名称。
503477

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+
504486
<!--
505487
### Adding kube-proxy parameters {#kube-proxy}
506488
@@ -661,13 +643,14 @@ The following phase command can be used to re-upload the certificates after expi
661643
```shell
662644
kubeadm init phase upload-certs --upload-certs --config=SOME_YAML_FILE
663645
```
646+
664647
{{< note >}}
665648
<!--
666649
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`.
668651
-->
669652
在使用 `--config`
670-
传递[配置文件](/zh-cn/docs/reference/config-api/kubeadm-config.v1beta3/)时,
653+
传递[配置文件](/zh-cn/docs/reference/config-api/kubeadm-config.v1beta4/)时,
671654
可以在 `InitConfiguration` 中提供预定义的 `certificateKey`
672655
{{< /note >}}
673656

0 commit comments

Comments
 (0)
Please sign in to comment.