Skip to content

Commit a3861c0

Browse files
authored
Merge pull request #27722 from tengqm/zh-sync-kubeadm-2
[zh] Resync kubeadm files (2)
2 parents bae064d + f0f5efe commit a3861c0

File tree

8 files changed

+2368
-203
lines changed

8 files changed

+2368
-203
lines changed

content/zh/docs/reference/config-api/kube-proxy-config.v1alpha1.md

Lines changed: 601 additions & 0 deletions
Large diffs are not rendered by default.

content/zh/docs/reference/config-api/kubelet-config.v1beta1.md

Lines changed: 1604 additions & 0 deletions
Large diffs are not rendered by default.

content/zh/docs/reference/setup-tools/kubeadm/implementation-details.md

Lines changed: 41 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ with the aim of sharing knowledge on Kubernetes cluster best practices.
4646
- lock-down the kubelet API
4747
- locking down access to the API for system components like the kube-proxy and CoreDNS
4848
- locking down what a Bootstrap Token can access
49-
- **Easy to use**: The user should not have to run anything more than a couple of commands:
49+
- **User-friendly**: The user should not have to run anything more than a couple of commands:
5050
- `kubeadm init`
5151
- `export KUBECONFIG=/etc/kubernetes/admin.conf`
5252
- `kubectl apply -f <network-of-choice.yaml>`
@@ -63,7 +63,7 @@ with the aim of sharing knowledge on Kubernetes cluster best practices.
6363
- 锁定 kubelet API
6464
- 锁定对系统组件(例如 kube-proxy 和 CoreDNS)的 API 的访问
6565
- 锁定启动引导令牌(Bootstrap Token)可以访问的内容
66-
- **易用的**:用户只需要运行几个命令即可:
66+
- **用户友好**:用户只需要运行几个命令即可:
6767
- `kubeadm init`
6868
- `export KUBECONFIG=/etc/kubernetes/admin.conf`
6969
- `kubectl apply -f <所选网络.yaml>`
@@ -558,7 +558,7 @@ API 服务器的静态 Pod 清单会受到用户提供的以下参数的影响:
558558
- `--requestheader-client-ca-file` to`front-proxy-ca.crt`
559559
- `--proxy-client-cert-file` to `front-proxy-client.crt`
560560
- `--proxy-client-key-file` to `front-proxy-client.key`
561-
- Other flags for securing the front proxy ([API Aggregation](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/aggregated-api-servers.md)) communications:
561+
- Other flags for securing the front proxy ([API Aggregation](/docs/concepts/extend-kubernetes/api-extension/apiserver-aggregation/)) communications:
562562
- `--requestheader-username-headers=X-Remote-User`
563563
- `--requestheader-group-headers=X-Remote-Group`
564564
- `--requestheader-extra-headers-prefix=X-Remote-Extra-`
@@ -580,7 +580,7 @@ API 服务器的静态 Pod 清单会受到用户提供的以下参数的影响:
580580
- `--proxy-client-key-file` 设为 `front-proxy-client.key`
581581

582582
- 其他用于保护前端代理(
583-
[API 聚合层](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/aggregated-api-servers.md)
583+
[API 聚合层](/zh/docs/concepts/extend-kubernetes/api-extension/apiserver-aggregation/)
584584
通信的标志:
585585

586586
- `--requestheader-username-headers=X-Remote-User`
@@ -697,7 +697,7 @@ into `/var/lib/kubelet/config/init/kubelet` file.
697697
<!--
698698
The init configuration is used for starting the kubelet on this specific node, providing an alternative for the kubelet drop-in file;
699699
such configuration will be replaced by the kubelet base configuration as described in following steps.
700-
See [set Kubelet parameters via a config file](/docs/tasks/administer-cluster/kubelet-config-file) for additional info.
700+
See [set Kubelet parameters via a config file](/docs/tasks/administer-cluster/kubelet-config-file) for additional information.
701701
-->
702702
初始化配置用于在这个特定节点上启动 kubelet,从而为 kubelet 插件文件提供了
703703
一种替代方法。如以下步骤中所述,这种配置将由 kubelet 基本配置所替代。
@@ -710,17 +710,24 @@ See [set Kubelet parameters via a config file](/docs/tasks/administer-cluster/ku
710710
<!--
711711
1. To make dynamic kubelet configuration work, flag `--dynamic-config-dir=/var/lib/kubelet/config/dynamic` should be specified
712712
in `/etc/systemd/system/kubelet.service.d/10-kubeadm.conf`
713-
2. The kubelet configuration can be changed by passing a `KubeletConfiguration` object to `kubeadm init` or `kubeadm join` by using
713+
1. The kubelet configuration can be changed by passing a `KubeletConfiguration` object to `kubeadm init` or `kubeadm join` by using
714714
a configuration file `--config some-file.yaml`. The `KubeletConfiguration` object can be separated from other objects such
715715
as `InitConfiguration` using the `---` separator. For more details have a look at the `kubeadm config print-default` command.
716716
-->
717717
1. 要使动态 kubelet 配置生效,应在 `/etc/systemd/system/kubelet.service.d/10-kubeadm.conf`
718718
中指定 `--dynamic-config-dir=/var/lib/kubelet/config/dynamic` 标志。
719-
2. 通过使用配置文件 `--config some-file.yaml``KubeletConfiguration` 对象传递给
719+
1. 通过使用配置文件 `--config some-file.yaml``KubeletConfiguration` 对象传递给
720720
`kubeadm init``kubeadm join` 来更改 kubelet 配置。
721721
可以使用 `---` 分隔符将 `KubeletConfiguration` 对象与其他对象(例如 `InitConfiguration`
722722
分开。更多的详细信息,请查看 `kubeadm config print-default` 命令。
723723

724+
<!--
725+
For more details about the `KubeletConfiguration` struct, take a look at the
726+
[`KubeletConfiguration` reference](/docs/reference/config-api/kubelet-config.v1beta1/).
727+
-->
728+
有关 `KubeletConfiguration` 结构的详细信息,可参阅
729+
[`KubeletConfiguration` 参考文档](/docs/reference/config-api/kubelet-config.v1beta1/)
730+
724731
<!--
725732
### Wait for the control plane to come up
726733
-->
@@ -748,7 +755,7 @@ kubeadm 依靠 kubelet 拉取控制平面镜像并将其作为静态 Pod 正确
748755
-->
749756
### (可选)编写基本 kubelet 配置 {#write-base-kubelet-configuration}
750757

751-
{{< feature-state for_k8s_version="v1.9" state="alpha" >}}
758+
{{< feature-state for_k8s_version="v1.11" state="beta" >}}
752759

753760
<!--
754761
If kubeadm is invoked with `--feature-gates=DynamicKubeletConfig`:
@@ -1028,24 +1035,28 @@ A ServiceAccount for `kube-proxy` is created in the `kube-system` namespace; the
10281035
- `kube-proxy` 的 ServiceAccount 绑定了 `system:node-proxier` ClusterRole
10291036
中的特权
10301037

1031-
#### DNS {#dns}
1038+
#### DNS
10321039

10331040
<!--
1034-
- In Kubernetes version 1.18 kube-dns usage with kubeadm is deprecated and will be removed in a future release
10351041
- The CoreDNS service is named `kube-dns`. This is done to prevent any interruption
1036-
in service when the user is switching the cluster DNS from kube-dns to CoreDNS or vice-versa
1037-
the `--config` method described [here](/docs/reference/setup-tools/kubeadm/kubeadm-init-phase/#cmd-phase-addon)
1038-
- A ServiceAccount for CoreDNS/kube-dns is created in the `kube-system` namespace.
1039-
- The `kube-dns` ServiceAccount is bound to the privileges in the `system:kube-dns` ClusterRole
1042+
in service when the user is switching the cluster DNS from kube-dns to CoreDNS,
1043+
the `--config` method described [here](/docs/reference/setup-tools/kubeadm/kubeadm-init-phase/#cmd-phase-addon)
1044+
- A ServiceAccount for CoreDNS is created in the `kube-system` namespace.
1045+
- The `coredns` ServiceAccount is bound to the privileges in the `system:coredns` ClusterRole
10401046
-->
1041-
- 在 Kubernetes 1.18 版本中,通过 kubeadm 部署 kube-dns 这一操作已经弃用,
1042-
将在未来的版本中删除。
10431047
- CoreDNS 服务的名称为 `kube-dns`。这样做是为了防止当用户将集群 DNS 从 kube-dns
1044-
切换到 CoreDNS 或者反过来时,出现服务中断`--config` 方法在
1048+
切换到 CoreDNS 时出现服务中断`--config` 方法在
10451049
[这里](/zh/docs/reference/setup-tools/kubeadm/kubeadm-init-phase/#cmd-phase-addon)
10461050
有描述。
1047-
-`kube-system` 名字空间中创建 CoreDNS/kube-dns 的 ServiceAccount
1048-
- `kube-dns` 的 ServiceAccount 绑定了 `system:kube-dns` ClusterRole 中的特权
1051+
-`kube-system` 名字空间中创建 CoreDNS 的 ServiceAccount
1052+
- `coredns` 的 ServiceAccount 绑定了 `system:coredns` ClusterRole 中的特权
1053+
1054+
<!--
1055+
In Kubernetes version 1.21, support for using `kube-dns` with kubeadm was removed.
1056+
You can use CoreDNS with kubeadm even when the related Service is named `kube-dns`.
1057+
-->
1058+
在 Kubernetes 1.21 版本中,kubeadm 对 `kube-dns` 的支持被移除。
1059+
你可以在 kubeadm 使用 CoreDNS,即使相关的 Service 名字仍然是 `kube-dns`
10491060

10501061
<!--
10511062
## kubeadm join phases internal design
@@ -1183,17 +1194,16 @@ when the connection with the cluster is established, kubeadm try to access the `
11831194
## TLS 引导 {#tls-boostrap}
11841195

11851196
<!--
1186-
Once the cluster info are known, the file `bootstrap-kubelet.conf` is written, thus allowing kubelet to do TLS Bootstrapping
1187-
(conversely until v.1.7 TLS bootstrapping were managed by kubeadm).
1197+
Once the cluster info are known, the file `bootstrap-kubelet.conf` is written, thus allowing kubelet to do TLS Bootstrapping.
11881198
-->
1189-
知道集群信息后,将写入文件 `bootstrap-kubelet.conf`,从而允许 kubelet 执行
1190-
TLS 引导(相反,在 v1.7 之前 TLS 引导都是由 kubeadm 管理)
1199+
知道集群信息后,kubeadm 将写入文件 `bootstrap-kubelet.conf`,从而允许 kubelet 执行
1200+
TLS 引导。
11911201

11921202
<!--
1193-
The TLS bootstrap mechanism uses the shared token to temporarily authenticate with the Kubernetes Master to submit a certificate
1203+
The TLS bootstrap mechanism uses the shared token to temporarily authenticate with the Kubernetes API server to submit a certificate
11941204
signing request (CSR) for a locally created key pair.
11951205
-->
1196-
TLS 引导机制使用共享令牌对 Kubernetes 主控节点进行临时身份验证,以便
1206+
TLS 引导机制使用共享令牌对 Kubernetes API 服务器进行临时身份验证,以便
11971207
为本地创建的密钥对提交证书签名请求(CSR)。
11981208

11991209
<!--
@@ -1209,7 +1219,7 @@ kubelet 加入集群,同时删除 `bootstrap-kubelet.conf`。
12091219
<!--
12101220
- The temporary authentication is validated against the token saved during the `kubeadm init` process (or with additional tokens
12111221
created with `kubeadm token`)
1212-
- The temporary authentication resolve to a user member of `system:bootstrappers:kubeadm:default-node-token` group which was granted
1222+
- The temporary authentication resolve to a user member of `system:bootstrappers:kubeadm:default-node-token` group which was granted
12131223
access to CSR api during the `kubeadm init` process
12141224
- The automatic CSR approval is managed by the csrapprover controller, according with configuration done the `kubeadm init` process
12151225
-->
@@ -1222,24 +1232,24 @@ kubelet 加入集群,同时删除 `bootstrap-kubelet.conf`。
12221232
<!--
12231233
### (optional) Write init kubelet configuration
12241234
-->
1225-
### (可选)编写 init kubelet 配置 {#write-init-kubelet-configuration}
1235+
### (可选)写入初始的 kubelet 配置 {#write-init-kubelet-configuration}
12261236

1227-
{{< feature-state for_k8s_version="v1.9" state="alpha" >}}
1237+
{{< feature-state for_k8s_version="v1.11" state="beta" >}}
12281238

12291239
<!--
12301240
If kubeadm is invoked with `--feature-gates=DynamicKubeletConfig`:
12311241
-->
12321242
如果带 `--feature-gates=DynamicKubeletConfig` 参数调用 kubeadm,则 kubeadm:
12331243

12341244
<!--
1235-
1. Read the kubelet base configuration from the `kubelet-base-config-v1.9` ConfigMap in the `kube-system` namespace using the
1245+
1. Read the kubelet base configuration from the `kubelet-base-config-v1.x` ConfigMap in the `kube-system` namespace using the
12361246
Bootstrap Token credentials, and write it to disk as kubelet init configuration file `/var/lib/kubelet/config/init/kubelet`
12371247
2. As soon as kubelet starts with the Node's own credential (`/etc/kubernetes/kubelet.conf`), update current node configuration
12381248
specifying that the source for the node/kubelet configuration is the above ConfigMap.
12391249
-->
1240-
1. 使用引导令牌凭证从 `kube-system` 名字空间中 ConfigMap `kubelet-base-config-v1.9`
1250+
1. 使用引导令牌凭证从 `kube-system` 名字空间中 ConfigMap `kubelet-base-config-v1.x`
12411251
中读取 kubelet 基本配置,
1242-
并将其作为 kubelet init 配置文件 `/var/lib/kubelet/config/init/kubelet` 写入磁盘。
1252+
并将其作为 kubelet 初始配置文件 `/var/lib/kubelet/config/init/kubelet` 写入磁盘。
12431253
2. 一旦 kubelet 开始使用节点自己的凭据(`/etc/kubernetes/kubelet.conf`),
12441254
就更新当前节点配置,指定该节点或 kubelet 配置来自上述 ConfigMap。
12451255

content/zh/docs/reference/setup-tools/kubeadm/kubeadm-alpha.md

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -18,47 +18,10 @@ weight: 90
1818
请试用这些功能并给我们提供反馈!
1919
{{< /caution >}}
2020

21-
## kubeadm alpha kubeconfig user {#cmd-phase-kubeconfig}
22-
23-
<!--
24-
The `user` subcommand can be used for the creation of kubeconfig files for additional users.
25-
-->
26-
使用子命令 `user` 为其他用户创建 kubeconfig 文件。
27-
28-
{{< tabs name="tab-kubeconfig" >}}
29-
{{< tab name="kubeconfig" include="generated/kubeadm_alpha_kubeconfig.md" />}}
30-
{{< tab name="user" include="generated/kubeadm_alpha_kubeconfig_user.md" />}}
31-
{{< /tabs >}}
32-
33-
## kubeadm alpha kubelet config {#cmd-phase-kubelet}
34-
3521
<!--
36-
Use the following command to enable the DynamicKubeletConfiguration feature.
22+
Currently there are no experimental commands under `kubeadm alpha`.
3723
-->
38-
使用以下命令启用 DynamicKubeletConfiguration 功能。
39-
40-
{{< tabs name="tab-kubelet" >}}
41-
{{< tab name="kubelet" include="generated/kubeadm_alpha_kubelet.md" />}}
42-
{{< tab name="enable-dynamic" include="generated/kubeadm_alpha_kubelet_config_enable-dynamic.md" />}}
43-
{{< /tabs >}}
44-
45-
## kubeadm alpha selfhosting pivot {#cmd-selfhosting}
46-
47-
<!--
48-
The subcommand `pivot` can be used to convert a static Pod-hosted control plane into a self-hosted one.
49-
-->
50-
子命令 `pivot` 可用于将 Pod 托管的静态控制平面转换为自托管的控制平面。
51-
有关 `pivot` 更多信息,请参见
52-
[文档](/zh/docs/setup/production-environment/tools/kubeadm/self-hosting/)
53-
54-
<!--
55-
[Documentation](/docs/setup/production-environment/tools/kubeadm/self-hosting/)
56-
-->
57-
58-
{{< tabs name="selfhosting" >}}
59-
{{< tab name="selfhosting" include="generated/kubeadm_alpha_selfhosting.md" />}}
60-
{{< tab name="pivot" include="generated/kubeadm_alpha_selfhosting_pivot.md" />}}
61-
{{< /tabs >}}
24+
目前在 `kubeadm alpha` 之下没有试验性质的命令。
6225

6326
## {{% heading "whatsnext" %}}
6427

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

Lines changed: 18 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,25 @@ weight: 90
44
content_type: concept
55
---
66
<!--
7-
---
87
title: kubeadm init phase
98
weight: 90
109
content_type: concept
11-
---
1210
-->
1311

1412
<!--
1513
`kubeadm init phase` enables you to invoke atomic steps of the bootstrap process.
1614
Hence, you can let kubeadm do some of the work and you can fill in the gaps
1715
if you wish to apply customization.
1816
-->
19-
`kubeadm init phase` 能确保调用引导过程的原子步骤。因此,如果希望自定义应用,则可以让 kubeadm 做一些工作,然后填补空白。
20-
17+
`kubeadm init phase` 能确保调用引导过程的原子步骤。
18+
因此,如果希望自定义应用,则可以让 kubeadm 做一些工作,然后填补空白。
2119

2220
<!--
2321
`kubeadm init phase` is consistent with the [kubeadm init workflow](/docs/reference/setup-tools/kubeadm/kubeadm-init/#init-workflow),
2422
and behind the scene both use the same code.
2523
-->
26-
`kubeadm init phase`[kubeadm init 工作流](/zh/docs/reference/setup-tools/kubeadm/kubeadm-init/#init-workflow)一致,后台都使用相同的代码。
24+
`kubeadm init phase`[kubeadm init 工作流](/zh/docs/reference/setup-tools/kubeadm/kubeadm-init/#init-workflow)
25+
一致,后台都使用相同的代码。
2726

2827
<!--
2928
## kubeadm init phase preflight {#cmd-phase-preflight}
@@ -143,7 +142,8 @@ Use the following phase to create a local etcd instance based on a static Pod fi
143142
You can use this command to upload the kubeadm configuration to your cluster.
144143
Alternatively, you can use [kubeadm config](/docs/reference/setup-tools/kubeadm/kubeadm-config/).
145144
-->
146-
可以使用此命令将 kubeadm 配置文件上传到集群。或者使用 [kubeadm config](/zh/docs/reference/setup-tools/kubeadm/kubeadm-config/)
145+
可以使用此命令将 kubeadm 配置文件上传到集群。或者使用
146+
[kubeadm config](/zh/docs/reference/setup-tools/kubeadm/kubeadm-config/)
147147

148148
{{< tabs name="upload-config" >}}
149149
{{< tab name="upload-config" include="generated/kubeadm_init_phase_upload-config.md" />}}
@@ -177,7 +177,8 @@ By default the certs and encryption key expire after two hours.
177177
<!--
178178
Use the following phase to label and taint the node with the `node-role.kubernetes.io/master=""` key-value pair.
179179
-->
180-
使用以下阶段来给具有 `node-role.kubernetes.io/master=""` 键值对的节点打标签(label)和记录污点(taint)。
180+
使用以下阶段来给具有 `node-role.kubernetes.io/master=""` 键值对的节点
181+
打标签(label)和记录污点(taint)。
181182

182183
{{< tabs name="tab-mark-control-plane" >}}
183184
{{< tab name="mark-control-plane" include="generated/kubeadm_init_phase_mark-control-plane.md" />}}
@@ -232,50 +233,12 @@ install them selectively.
232233
{{< tab name="kube-proxy" include="generated/kubeadm_init_phase_addon_kube-proxy.md" />}}
233234
{{< /tabs >}}
234235

235-
<!--
236-
To use kube-dns instead of CoreDNS you have to pass a configuration file:
237-
-->
238-
要使用 kube-dns 代替 CoreDNS,必须传递一个配置文件:
239-
240-
<!--
241-
# for installing a DNS addon only
242-
# 仅用于安装 DNS 插件
243-
# for creating a complete control plane node
244-
# 用于创建完整的控制平面节点
245-
# for listing or pulling images
246-
# 用于列出或者拉取镜像
247-
# for upgrades
248-
-->
249-
250-
```bash
251-
# 仅用于安装 DNS 插件
252-
kubeadm init phase addon coredns --config=someconfig.yaml
253-
# 用于创建完整的控制平面节点
254-
kubeadm init --config=someconfig.yaml
255-
# 用于列出或者拉取镜像
256-
kubeadm config images list/pull --config=someconfig.yaml
257-
# 升级
258-
kubeadm upgrade apply --config=someconfig.yaml
259-
```
260-
261-
<!--
262-
The file has to contain a [`DNS`](https://godoc.org/k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta2#DNS) field in[`ClusterConfiguration`](https://godoc.org/k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta2#ClusterConfiguration)
263-
and also a type for the addon - `kube-dns` (default value is `CoreDNS`).
264-
-->
265-
该文件必须在 [`ClusterConfiguration`](https://godoc.org/k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta2#ClusterConfiguration) 中包含一个 [`DNS`](https://godoc.org/k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta2#DNS) 字段,以及包含一个插件的类型 - `kube-dns`(默认值为 `CoreDNS`)。
266-
267-
```yaml
268-
apiVersion: kubeadm.k8s.io/v1beta2
269-
kind: ClusterConfiguration
270-
dns:
271-
type: "kube-dns"
272-
```
273-
274236
<!--
275237
For more details on each field in the `v1beta2` configuration you can navigate to our
276238
[API reference pages.] (https://godoc.org/k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta2)
277239
-->
278-
有关 `v1beta2` 配置中每个字段的更多详细信息,可以访问 [API](https://godoc.org/k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta2)。
240+
有关 `v1beta2` 配置中每个字段的更多详细信息,可以访问
241+
[API](https://godoc.org/k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta2)
279242

280243
## {{% heading "whatsnext" %}}
281244

@@ -285,7 +248,11 @@ For more details on each field in the `v1beta2` configuration you can navigate t
285248
* [kubeadm reset](/docs/reference/setup-tools/kubeadm/kubeadm-reset/) to revert any changes made to this host by `kubeadm init` or `kubeadm join`
286249
* [kubeadm alpha](/docs/reference/setup-tools/kubeadm/kubeadm-alpha/) to try experimental functionality
287250
-->
288-
* [kubeadm init](/zh/docs/reference/setup-tools/kubeadm/kubeadm-init/) 引导 Kubernetes 控制平面节点
289-
* [kubeadm join](/zh/docs/reference/setup-tools/kubeadm/kubeadm-join/) 将节点连接到集群
290-
* [kubeadm reset](/zh/docs/reference/setup-tools/kubeadm/kubeadm-reset/) 恢复通过 `kubeadm init` 或 `kubeadm join` 操作对主机所做的任何更改
291-
* [kubeadm alpha](/zh/docs/reference/setup-tools/kubeadm/kubeadm-alpha/) 尝试实验性功能
251+
* [kubeadm init](/zh/docs/reference/setup-tools/kubeadm/kubeadm-init/)
252+
引导 Kubernetes 控制平面节点
253+
* [kubeadm join](/zh/docs/reference/setup-tools/kubeadm/kubeadm-join/)
254+
将节点加入到集群
255+
* [kubeadm reset](/zh/docs/reference/setup-tools/kubeadm/kubeadm-reset/)
256+
恢复通过 `kubeadm init``kubeadm join` 操作对主机所做的任何更改
257+
* [kubeadm alpha](/zh/docs/reference/setup-tools/kubeadm/kubeadm-alpha/)
258+
尝试实验性功能

0 commit comments

Comments
 (0)