Skip to content

Commit 00ed412

Browse files
committed
sync control-plane-flags install-kubeadm troubleshooting-kubeadm
Update troubleshooting-kubeadm.md
1 parent 3dd2342 commit 00ed412

File tree

3 files changed

+42
-34
lines changed

3 files changed

+42
-34
lines changed

content/zh-cn/docs/setup/production-environment/tools/kubeadm/control-plane-flags.md

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ and kube-proxy you can use `KubeletConfiguration` and `KubeProxyConfiguration`,
2020
2121
All of these options are possible via the kubeadm configuration API.
2222
For more details on each field in the configuration you can navigate to our
23-
[API reference pages](/docs/reference/config-api/kubeadm-config.v1beta3/).
23+
[API reference pages](/docs/reference/config-api/kubeadm-config.v1beta4/).
2424
-->
2525
本页面介绍了如何自定义 kubeadm 部署的组件。
2626
你可以使用 `ClusterConfiguration` 结构中定义的参数,或者在每个节点上应用补丁来定制控制平面组件。
2727
你可以使用 `KubeletConfiguration``KubeProxyConfiguration` 结构分别定制 kubelet 和 kube-proxy 组件。
2828

2929
所有这些选项都可以通过 kubeadm 配置 API 实现。
3030
有关配置中的每个字段的详细信息,你可以导航到我们的
31-
[API 参考页面](/zh-cn/docs/reference/config-api/kubeadm-config.v1beta3/)
31+
[API 参考页面](/zh-cn/docs/reference/config-api/kubeadm-config.v1beta4/)
3232

3333
{{< note >}}
3434
<!--
@@ -75,10 +75,10 @@ kubeadm `ClusterConfiguration` 对象为用户提供了一种方法,
7575
- `etcd`
7676

7777
<!--
78-
These structures contain a common `extraArgs` field, that consists of `key: value` pairs.
78+
These structures contain a common `extraArgs` field, that consists of `name` / `value` pairs.
7979
To override a flag for a control plane component:
8080
-->
81-
这些结构包含一个通用的 `extraArgs` 字段,该字段由 `key: value` 组成。
81+
这些结构包含一个通用的 `extraArgs` 字段,该字段由 `name` / `value` 组成。
8282
要覆盖控制平面组件的参数:
8383

8484
<!--
@@ -135,14 +135,15 @@ Example usage:
135135
使用示例:
136136

137137
```yaml
138-
apiVersion: kubeadm.k8s.io/v1beta3
138+
apiVersion: kubeadm.k8s.io/v1beta4
139139
kind: ClusterConfiguration
140140
kubernetesVersion: v1.16.0
141141
apiServer:
142142
extraArgs:
143-
anonymous-auth: "false"
144-
enable-admission-plugins: AlwaysPullImages,DefaultStorageClass
145-
audit-log-path: /home/johndoe/audit.log
143+
- name: "enable-admission-plugins"
144+
value: "AlwaysPullImages,DefaultStorageClass"
145+
- name: "audit-log-path"
146+
value: "/home/johndoe/audit.log"
146147
```
147148
148149
<!--
@@ -161,13 +162,15 @@ Example usage:
161162
使用示例:
162163
163164
```yaml
164-
apiVersion: kubeadm.k8s.io/v1beta3
165+
apiVersion: kubeadm.k8s.io/v1beta4
165166
kind: ClusterConfiguration
166167
kubernetesVersion: v1.16.0
167168
controllerManager:
168169
extraArgs:
169-
cluster-signing-key-file: /home/johndoe/keys/ca.key
170-
deployment-controller-sync-period: "50"
170+
- name: "cluster-signing-key-file"
171+
value: "/home/johndoe/keys/ca.key"
172+
- name: "deployment-controller-sync-period"
173+
value: "50"
171174
```
172175
173176
<!--
@@ -186,12 +189,13 @@ Example usage:
186189
使用示例:
187190
188191
```yaml
189-
apiVersion: kubeadm.k8s.io/v1beta3
192+
apiVersion: kubeadm.k8s.io/v1beta4
190193
kind: ClusterConfiguration
191194
kubernetesVersion: v1.16.0
192195
scheduler:
193196
extraArgs:
194-
config: /etc/kubernetes/scheduler-config.yaml
197+
- name: "config"
198+
value: "/etc/kubernetes/scheduler-config.yaml"
195199
extraVolumes:
196200
- name: schedulerconfig
197201
hostPath: /home/johndoe/schedconfig.yaml
@@ -213,12 +217,13 @@ Example usage:
213217
使用示例:
214218
215219
```yaml
216-
apiVersion: kubeadm.k8s.io/v1beta3
220+
apiVersion: kubeadm.k8s.io/v1beta4
217221
kind: ClusterConfiguration
218222
etcd:
219223
local:
220224
extraArgs:
221-
election-timeout: 1000
225+
- name: "election-timeout"
226+
value: 1000
222227
```
223228
<!--
224229
## Customizing with patches {#patches}
@@ -239,7 +244,7 @@ Kubeadm 允许将包含补丁文件的目录传递给各个节点上的 `InitCon
239244
可以使用 `--config <你的 YAML 格式控制文件>` 将配置文件传递给 `kubeadm init`:
240245

241246
```yaml
242-
apiVersion: kubeadm.k8s.io/v1beta3
247+
apiVersion: kubeadm.k8s.io/v1beta4
243248
kind: InitConfiguration
244249
patches:
245250
directory: /home/user/somedir
@@ -259,7 +264,7 @@ You can pass this file to `kubeadm join` with `--config <YOUR CONFIG YAML>`:
259264
你可以使用 `--config <你的 YAML 格式配置文件>` 将配置文件传递给 `kubeadm join`:
260265

261266
```yaml
262-
apiVersion: kubeadm.k8s.io/v1beta3
267+
apiVersion: kubeadm.k8s.io/v1beta4
263268
kind: JoinConfiguration
264269
patches:
265270
directory: /home/user/somedir
@@ -343,14 +348,14 @@ For additional details see [Configuring each kubelet in your cluster using kubea
343348
To customize kube-proxy you can pass a `KubeProxyConfiguration` next your `ClusterConfiguration` or
344349
`InitConfiguration` to `kubeadm init` separated by `---`.
345350

346-
For more details you can navigate to our [API reference pages](/docs/reference/config-api/kubeadm-config.v1beta3/).
351+
For more details you can navigate to our [API reference pages](/docs/reference/config-api/kubeadm-config.v1beta4/).
347352
-->
348353
## 自定义 kube-proxy {#customizing-kube-proxy}
349354

350355
要自定义 kube-proxy,你可以在 `ClusterConfiguration` 或 `InitConfiguration`
351356
之外添加一个由 `---` 分隔的 `KubeProxyConfiguration`, 传递给 `kubeadm init`。
352357

353-
可以导航到 [API 参考页面](/zh-cn/docs/reference/config-api/kubeadm-config.v1beta3/)查看更多详情,
358+
可以导航到 [API 参考页面](/zh-cn/docs/reference/config-api/kubeadm-config.v1beta4/)查看更多详情,
354359

355360
{{< note >}}
356361
<!--

content/zh-cn/docs/setup/production-environment/tools/kubeadm/install-kubeadm.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -490,12 +490,12 @@ sudo mkdir -p "$DOWNLOAD_DIR"
490490
```
491491
492492
<!--
493-
Install crictl (required for kubeadm / Kubelet Container Runtime Interface (CRI)):
493+
Optionally install crictl (required for interaction with the Container Runtime Interface (CRI), optional for kubeadm):
494494
-->
495-
安装 crictl(kubeadm/kubelet 容器运行时接口(CRI)所需):
495+
可以选择安装 crictl(与容器运行时接口 (CRI) 交互时必需,但对 kubeadm 来说是可选的):
496496
497497
```bash
498-
CRICTL_VERSION="v1.30.0"
498+
CRICTL_VERSION="v1.31.0"
499499
ARCH="amd64"
500500
curl -L "http://github.com/kubernetes-sigs/cri-tools/releases/download/${CRICTL_VERSION}/crictl-${CRICTL_VERSION}-linux-${ARCH}.tar.gz" | sudo tar -C $DOWNLOAD_DIR -xz
501501
```

content/zh-cn/docs/setup/production-environment/tools/kubeadm/troubleshooting-kubeadm.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -470,14 +470,14 @@ Error from server: Get http://10.19.0.41:10250/containerLogs/default/mysql-ddc6
470470
When using DigitalOcean, it can be the public one (assigned to `eth0`) or
471471
the private one (assigned to `eth1`) should you want to use the optional
472472
private network. The `kubeletExtraArgs` section of the kubeadm
473-
[`NodeRegistrationOptions` structure](/docs/reference/config-api/kubeadm-config.v1beta3/#kubeadm-k8s-io-v1beta3-NodeRegistrationOptions)
473+
[`NodeRegistrationOptions` structure](/docs/reference/config-api/kubeadm-config.v1beta4/#kubeadm-k8s-io-v1beta4-NodeRegistrationOptions)
474474
can be used for this.
475475

476476
Then restart `kubelet`:
477477
-->
478478
解决方法是通知 `kubelet` 使用哪个 `--node-ip`。当使用 DigitalOcean 时,可以是(分配给 `eth0` 的)公网 IP,
479479
或者是(分配给 `eth1` 的)私网 IP。私网 IP 是可选的。
480-
[kubadm `NodeRegistrationOptions` 结构](/zh-cn/docs/reference/config-api/kubeadm-config.v1beta3/#kubeadm-k8s-io-v1beta3-NodeRegistrationOptions)
480+
kubadm [`NodeRegistrationOptions` 结构](/zh-cn/docs/reference/config-api/kubeadm-config.v1beta4/#kubeadm-k8s-io-v1beta4-NodeRegistrationOptions)
481481
的 `KubeletExtraArgs` 部分被用来处理这种情况。
482482

483483
然后重启 `kubelet`:
@@ -591,7 +591,7 @@ Alternatively, you can try separating the `key=value` pairs like so:
591591
`--apiserver-extra-args "enable-admission-plugins=LimitRanger,enable-admission-plugins=NamespaceExists"`
592592
but this will result in the key `enable-admission-plugins` only having the value of `NamespaceExists`.
593593

594-
A known workaround is to use the kubeadm [configuration file](/docs/reference/config-api/kubeadm-config.v1beta3/).
594+
A known workaround is to use the kubeadm [configuration file](/docs/reference/config-api/kubeadm-config.v1beta4/).
595595
-->
596596
## 无法将以逗号分隔的值列表传递给 `--component-extra-args` 标志内的参数
597597

@@ -609,7 +609,7 @@ kube-apiserver 这样的控制平面组件。然而,由于解析 (`mapStringSt
609609
但这将导致键 `enable-admission-plugins` 仅有值 `NamespaceExists`。
610610

611611
已知的解决方法是使用 kubeadm
612-
[配置文件](/zh-cn/docs/reference/config-api/kubeadm-config.v1beta3/)。
612+
[配置文件](/zh-cn/docs/reference/config-api/kubeadm-config.v1beta4/)。
613613

614614
<!--
615615
## kube-proxy scheduled before node is initialized by cloud-controller-manager
@@ -694,29 +694,31 @@ FlexVolume 在 Kubernetes v1.23 版本中已被弃用。
694694

695695
<!--
696696
To workaround this issue, you can configure the flex-volume directory using the kubeadm
697-
[configuration file](/docs/reference/config-api/kubeadm-config.v1beta3/).
697+
[configuration file](/docs/reference/config-api/kubeadm-config.v1beta4/).
698698

699699
On the primary control-plane Node (created using `kubeadm init`), pass the following
700700
file using `--config`:
701701
-->
702-
为了解决这个问题,你可以使用 kubeadm 的[配置文件](/zh-cn/docs/reference/config-api/kubeadm-config.v1beta3/)来配置
702+
为了解决这个问题,你可以使用 kubeadm 的[配置文件](/zh-cn/docs/reference/config-api/kubeadm-config.v1beta4/)来配置
703703
FlexVolume 的目录。
704704

705705
在(使用 `kubeadm init` 创建的)主控制节点上,使用 `--config`
706706
参数传入如下文件:
707707

708708
```yaml
709-
apiVersion: kubeadm.k8s.io/v1beta3
709+
apiVersion: kubeadm.k8s.io/v1beta4
710710
kind: InitConfiguration
711711
nodeRegistration:
712712
kubeletExtraArgs:
713-
volume-plugin-dir: "/opt/libexec/kubernetes/kubelet-plugins/volume/exec/"
713+
- name: "volume-plugin-dir"
714+
value: "/opt/libexec/kubernetes/kubelet-plugins/volume/exec/"
714715
---
715-
apiVersion: kubeadm.k8s.io/v1beta3
716+
apiVersion: kubeadm.k8s.io/v1beta4
716717
kind: ClusterConfiguration
717718
controllerManager:
718719
extraArgs:
719-
flex-volume-plugin-dir: "/opt/libexec/kubernetes/kubelet-plugins/volume/exec/"
720+
- name: "flex-volume-plugin-dir"
721+
value: "/opt/libexec/kubernetes/kubelet-plugins/volume/exec/"
720722
```
721723

722724
<!--
@@ -725,11 +727,12 @@ On joining Nodes:
725727
在加入到集群中的节点上,使用下面的文件:
726728

727729
```yaml
728-
apiVersion: kubeadm.k8s.io/v1beta3
730+
apiVersion: kubeadm.k8s.io/v1beta4
729731
kind: JoinConfiguration
730732
nodeRegistration:
731733
kubeletExtraArgs:
732-
volume-plugin-dir: "/opt/libexec/kubernetes/kubelet-plugins/volume/exec/"
734+
- name: "volume-plugin-dir"
735+
value: "/opt/libexec/kubernetes/kubelet-plugins/volume/exec/"
733736
```
734737

735738
<!--

0 commit comments

Comments
 (0)