Skip to content

Commit 8aa9caf

Browse files
authored
Merge pull request #34605 from tengqm/zh-resync-changeruntime
[zh-cn] Resync change runtime to containerd
2 parents f8f19ef + 9d4fcf7 commit 8aa9caf

File tree

1 file changed

+31
-19
lines changed

1 file changed

+31
-19
lines changed

content/zh-cn/docs/tasks/administer-cluster/migrating-from-dockershim/change-runtime-containerd.md

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,16 @@ and for specific prerequisite follow
3838

3939
<!--
4040
## Drain the node
41-
42-
```shell
43-
kubectl drain <node-to-drain> --ignore-daemonsets
44-
```
45-
46-
Replace `<node-to-drain>` with the name of your node you are draining.
4741
-->
4842
## 腾空节点 {#drain-the-node}
4943

5044
```shell
5145
kubectl drain <node-to-drain> --ignore-daemonsets
5246
```
5347

48+
<!--
49+
Replace `<node-to-drain>` with the name of your node you are draining.
50+
-->
5451
`<node-to-drain>` 替换为你所要腾空的节点的名称
5552

5653
<!--
@@ -84,8 +81,8 @@ for detailed steps to install containerd.
8481
[Getting started with containerd](https://github.com/containerd/containerd/blob/main/docs/getting-started.md).
8582
-->
8683
1. 从官方的 Docker 仓库安装 `containerd.io` 包。关于为你所使用的 Linux 发行版来设置
87-
Docker 仓库,以及安装 `containerd.io` 包的详细说明,可参见
88-
[开始使用 containerd](https://github.com/containerd/containerd/blob/main/docs/getting-started.md)
84+
Docker 仓库,以及安装 `containerd.io` 包的详细说明,
85+
可参见[开始使用 containerd](https://github.com/containerd/containerd/blob/main/docs/getting-started.md)
8986

9087
<!--
9188
1. Configure containerd:
@@ -136,8 +133,8 @@ then run the following commands:
136133
.\containerd.exe config default | Out-File config.toml -Encoding ascii
137134
138135
# 请审查配置信息。取决于你的安装环境,你可能需要调整:
139-
# - the sandbox_image (Kubernetes pause 镜像)
140-
# - cni bin_dir 和 conf_dir 的位置
136+
# - sandbox_image (Kubernetes pause 镜像)
137+
# - CNI 的 bin_dir 和 conf_dir 的位置
141138
Get-Content config.toml
142139
143140
# (可选步骤,但强烈建议执行)将 containerd 排除在 Windows Defender 扫描之外
@@ -167,19 +164,17 @@ Edit the file `/var/lib/kubelet/kubeadm-flags.env` and add the containerd runtim
167164
## 配置 kubelet 使用 containerd 作为其容器运行时
168165

169166
编辑文件 `/var/lib/kubelet/kubeadm-flags.env`,将 containerd 运行时添加到标志中:
170-
`--container-runtime=remote``--container-runtime-endpoint=unix:///run/containerd/containerd.sock"`
167+
`--container-runtime=remote`
168+
`--container-runtime-endpoint=unix:///run/containerd/containerd.sock"`
171169

172170
<!--
173-
For users using kubeadm should consider the following:
174-
175171
Users using kubeadm should be aware that the `kubeadm` tool stores the CRI socket for each host as
176172
an annotation in the Node object for that host. To change it you can execute the following command
177173
on a machine that has the kubeadm `/etc/kubernetes/admin.conf` file.
178174
-->
179-
对于使用 kubeadm 的用户,可以考虑下面的问题:
180-
181175
`kubeadm` 工具将每个主机的 CRI 套接字保存在该主机对应的 Node 对象的注解中。
182-
使用 `kubeadm` 的用户应该知道,`kubeadm` 工具将每个主机的 CRI 套接字保存在该主机对应的 Node 对象的注解中。
176+
使用 `kubeadm` 的用户应该知道,`kubeadm` 工具将每个主机的 CRI 套接字保存在该主机对应的
177+
Node 对象的注解中。
183178
要更改这一注解信息,你可以在一台包含 kubeadm `/etc/kubernetes/admin.conf` 文件的机器上执行以下命令:
184179

185180
```shell
@@ -188,7 +183,6 @@ kubectl edit no <node-name>
188183

189184
<!--
190185
This will start a text editor where you can edit the Node object.
191-
192186
To choose a text editor you can set the `KUBE_EDITOR` environment variable.
193187
194188
- Change the value of `kubeadm.alpha.kubernetes.io/cri-socket` from `/var/run/dockershim.sock`
@@ -222,13 +216,16 @@ systemctl start kubelet
222216
## Verify that the node is healthy
223217
224218
Run `kubectl get nodes -o wide` and containerd appears as the runtime for the node we just changed.
225-
226-
## Remove Docker Engine
227219
-->
228220
## 验证节点处于健康状态 {#verify-that-the-node-is-healthy}
229221

230222
运行 `kubectl get nodes -o wide`,containerd 会显示为我们所更改的节点上的运行时。
231223

224+
<!--
225+
## Remove Docker Engine
226+
-->
227+
## 移除 Docker Engine {#remove-docker-engine}
228+
232229
{{% thirdparty-content %}}
233230

234231
<!--
@@ -263,3 +260,18 @@ sudo apt-get purge docker-ce docker-ce-cli
263260
{{% /tab %}}
264261
{{< /tabs >}}
265262

263+
<!--
264+
The preceding commands don't remove images, containers, volumes, or customized configuration files on your host.
265+
To delete them, follow Docker's instructions to [Uninstall Docker Engine](https://docs.docker.com/engine/install/ubuntu/#uninstall-docker-engine).
266+
-->
267+
上面的命令不会移除你的主机上的镜像、容器、卷或者定制的配置文件。
268+
要删除这些内容,参阅 Docker 的指令来[卸载 Docker Engine](https://docs.docker.com/engine/install/ubuntu/#uninstall-docker-engine)
269+
270+
{{< caution >}}
271+
<!--
272+
Docker's instructions for uninstalling Docker Engine create a risk of deleting containerd. Be careful when executing commands.
273+
-->
274+
Docker 所提供的卸载 Docker Engine 命令指导中,存在删除 containerd 的风险。
275+
在执行命令时要谨慎。
276+
{{< /caution >}}
277+

0 commit comments

Comments
 (0)