Skip to content

Commit 44269ec

Browse files
authored
Merge pull request #32898 from mengjiao-liu/fix_change_runtime_containerd_title_zh
[zh] Fix change-runtime-containerd.md title display error
2 parents df7785e + 4f70538 commit 44269ec

File tree

1 file changed

+42
-30
lines changed

1 file changed

+42
-30
lines changed

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

Lines changed: 42 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
---
12
title: 将节点上的容器运行时从 Docker Engine 改为 containerd
23
weight: 8
34
content_type: task
5+
---
46

57
<!--
68
title: "Changing the Container Runtime on a Node from Docker Engine to containerd"
@@ -9,7 +11,10 @@ content_type: task
911
-->
1012

1113
<!--
12-
This task outlines the steps needed to update your container runtime to containerd from Docker. It is applicable for cluster operators running Kubernetes 1.23 or earlier. Also this covers an example scenario for migrating from dockershim to containerd and alternative container runtimes can be picked from this [page](https://kubernetes.io/docs/setup/production-environment/container-runtimes/).
14+
This task outlines the steps needed to update your container runtime to containerd from Docker. It
15+
is applicable for cluster operators running Kubernetes 1.23 or earlier. Also this covers an
16+
example scenario for migrating from dockershim to containerd and alternative container runtimes
17+
can be picked from this [page](/docs/setup/production-environment/container-runtimes/).
1318
-->
1419
本任务给出将容器运行时从 Docker 改为 containerd 所需的步骤。
1520
此任务适用于运行 1.23 或更早版本 Kubernetes 的集群操作人员。
@@ -22,27 +27,32 @@ This task outlines the steps needed to update your container runtime to containe
2227
{{% thirdparty-content %}}
2328

2429
<!--
25-
Install containerd. For more information see, [containerd's installation documentation](https://containerd.io/docs/getting-started/) and for specific prerequisite follow [this](/docs/setup/production-environment/container-runtimes/#containerd).
30+
Install containerd. For more information see
31+
[containerd's installation documentation](https://containerd.io/docs/getting-started/)
32+
and for specific prerequisite follow
33+
[the containerd guide](/docs/setup/production-environment/container-runtimes/#containerd).
2634
-->
2735
安装 containerd。进一步的信息可参见
2836
[containerd 的安装文档](https://containerd.io/docs/getting-started/)
29-
关于一些特定的环境准备工作,请参阅[此页面](/zh/docs/setup/production-environment/container-runtimes/#containerd)
37+
关于一些特定的环境准备工作,请遵循 [containerd 指南](/zh/docs/setup/production-environment/container-runtimes/#containerd)
3038

3139
<!--
3240
## Drain the node
3341
34-
```
35-
# replace <node-to-drain> with the name of your node you are draining
42+
```shell
3643
kubectl drain <node-to-drain> --ignore-daemonsets
3744
```
45+
46+
Replace `<node-to-drain>` with the name of your node you are draining.
3847
-->
3948
## 腾空节点 {#drain-the-node}
4049

41-
```
42-
# 将 <node-to-drain> 替换为你所要腾空的节点的名称
50+
```shell
4351
kubectl drain <node-to-drain> --ignore-daemonsets
4452
```
4553

54+
`<node-to-drain>` 替换为你所要腾空的节点的名称
55+
4656
<!--
4757
## Stop the Docker daemon
4858
-->
@@ -56,27 +66,29 @@ systemctl disable docker.service --now
5666
<!--
5767
## Install Containerd
5868
59-
This [page](/docs/setup/production-environment/container-runtimes/#containerd) contains detailed steps to install containerd.
69+
Follow the [guide](/docs/setup/production-environment/container-runtimes/#containerd)
70+
for detailed steps to install containerd.
6071
-->
6172
## 安装 Containerd {#install-containerd}
6273

63-
[页面](/zh/docs/setup/production-environment/container-runtimes/#containerd)
64-
包含安装 containerd 的详细步骤。
74+
遵循此[指南](/zh/docs/setup/production-environment/container-runtimes/#containerd)
75+
了解安装 containerd 的详细步骤。
6576

6677
{{< tabs name="tab-cri-containerd-installation" >}}
6778
{{% tab name="Linux" %}}
6879

6980
<!--
7081
1. Install the `containerd.io` package from the official Docker repositories.
71-
Instructions for setting up the Docker repository for your respective Linux distribution and installing the `containerd.io` package can be found at
72-
[Install Docker Engine](https://docs.docker.com/engine/install/#server).
82+
Instructions for setting up the Docker repository for your respective Linux distribution and
83+
installing the `containerd.io` package can be found at
84+
[Install Docker Engine](https://docs.docker.com/engine/install/#server).
7385
-->
7486
1. 从官方的 Docker 仓库安装 `containerd.io` 包。关于为你所使用的 Linux 发行版来设置
7587
Docker 仓库,以及安装 `containerd.io` 包的详细说明,可参见
7688
[Install Docker Engine](https://docs.docker.com/engine/install/#server)
7789

7890
<!--
79-
2. Configure containerd:
91+
1. Configure containerd:
8092
-->
8193
2. 配置 containerd:
8294

@@ -86,19 +98,19 @@ Instructions for setting up the Docker repository for your respective Linux dist
8698
```
8799

88100
<!--
89-
3. Restart containerd:
101+
1. Restart containerd:
90102
-->
91103
3. 重启 containerd:
92104

93105
```shell
94106
sudo systemctl restart containerd
95107
```
96-
97108
{{% /tab %}}
98109
{{% tab name="Windows (PowerShell)" %}}
99110

100111
<!--
101-
Start a Powershell session, set `$Version` to the desired version (ex: `$Version="1.4.3"`), and then run the following commands:
112+
Start a Powershell session, set `$Version` to the desired version (ex: `$Version="1.4.3"`), and
113+
then run the following commands:
102114
-->
103115
启动一个 Powershell 会话,将 `$Version` 设置为期望的版本(例如:`$Version="1.4.3"`),
104116
之后运行下面的命令:
@@ -148,7 +160,9 @@ Start a Powershell session, set `$Version` to the desired version (ex: `$Version
148160
<!--
149161
## Configure the kubelet to use containerd as its container runtime
150162
151-
Edit the file `/var/lib/kubelet/kubeadm-flags.env` and add the containerd runtime to the flags. `--container-runtime=remote` and `--container-runtime-endpoint=unix:///run/containerd/containerd.sock"`
163+
Edit the file `/var/lib/kubelet/kubeadm-flags.env` and add the containerd runtime to the flags.
164+
`--container-runtime=remote` and
165+
`--container-runtime-endpoint=unix:///run/containerd/containerd.sock"`.
152166
-->
153167
## 配置 kubelet 使用 containerd 作为其容器运行时
154168

@@ -158,31 +172,29 @@ Edit the file `/var/lib/kubelet/kubeadm-flags.env` and add the containerd runtim
158172
<!--
159173
For users using kubeadm should consider the following:
160174
161-
The `kubeadm` tool stores the CRI socket for each host as an annotation in the Node object for that host.
175+
Users using kubeadm should be aware that the `kubeadm` tool stores the CRI socket for each host as
176+
an annotation in the Node object for that host. To change it you can execute the following command
177+
on a machine that has the kubeadm `/etc/kubernetes/admin.conf` file.
162178
-->
163179
对于使用 kubeadm 的用户,可以考虑下面的问题:
164180

165181
`kubeadm` 工具将每个主机的 CRI 套接字保存在该主机对应的 Node 对象的注解中。
182+
使用 `kubeadm` 的用户应该知道,`kubeadm` 工具将每个主机的 CRI 套接字保存在该主机对应的 Node 对象的注解中。
183+
要更改这一注解信息,你可以在一台包含 kubeadm `/etc/kubernetes/admin.conf` 文件的机器上执行以下命令:
166184

167-
<!--
168-
To change it you must do the following:
169-
170-
Execute `kubectl edit no <NODE-NAME>` on a machine that has the kubeadm `/etc/kubernetes/admin.conf` file.
171-
-->
172-
要更改这一注解信息,你必须执行下面的操作:
173-
174-
在一台包含 `/etc/kubernetes/admin.conf` 文件的机器上,执行
175-
`kubectl edit no <节点名称>`
185+
```shell
186+
kubectl edit no <node-name>
187+
```
176188

177189
<!--
178190
This will start a text editor where you can edit the Node object.
179191
180192
To choose a text editor you can set the `KUBE_EDITOR` environment variable.
181193
182194
- Change the value of `kubeadm.alpha.kubernetes.io/cri-socket` from `/var/run/dockershim.sock`
183-
to the CRI socket path of your choice (for example `unix:///run/containerd/containerd.sock`).
195+
to the CRI socket path of your choice (for example `unix:///run/containerd/containerd.sock`).
184196
185-
Note that new CRI socket paths must be prefixed with `unix://` ideally.
197+
Note that new CRI socket paths must be prefixed with `unix://` ideally.
186198
187199
- Save the changes in the text editor, which will update the Node object.
188200
-->
@@ -220,7 +232,7 @@ Run `kubectl get nodes -o wide` and containerd appears as the runtime for the no
220232
{{% thirdparty-content %}}
221233

222234
<!--
223-
Finally if everything goes well remove docker
235+
Finally if everything goes well, remove Docker.
224236
-->
225237
最后,在一切顺利时删除 Docker。
226238

0 commit comments

Comments
 (0)