Skip to content

Commit b879231

Browse files
authored
Merge pull request #33661 from TinySong/task-3
[zh] sync migrating-from-dockershim doc
2 parents e7300a1 + 2663c19 commit b879231

File tree

3 files changed

+153
-187
lines changed

3 files changed

+153
-187
lines changed

content/zh/docs/tasks/administer-cluster/migrating-from-dockershim/_index.md

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: "从 dockershim 迁移"
33
weight: 10
44
content_type: task
5+
no_list: true
56
---
67
<!--
78
title: "Migrating from dockershim"
@@ -28,7 +29,16 @@ to understand the problem better.
2829
各类疑问随之而来:这对各类工作负载和 Kubernetes 部署会产生什么影响。
2930
我们的[弃用 Dockershim 常见问题](/blog/2022/02/17/dockershim-faq/)可以帮助你更好地理解这个问题。
3031

31-
<!-- It is recommended to migrate from dockershim to alternative container runtimes.
32+
<!--
33+
Dockershim was removed from Kubernetes with the release of v1.24.
34+
If you use Docker via dockershim as your container runtime, and wish to upgrade to v1.24,
35+
it is recommended that you either migrate to another runtime or find an alternative means to obtain Docker Engine support.
36+
-->
37+
Dockershim 在 Kubernetes v1.24 版本已经被移除。
38+
如果你集群内是通过 dockershim 使用 Docker 作为容器运行时,并希望 Kubernetes 升级到 v1.24,
39+
建议你迁移到其他容器运行时或使用其他方法以获得 Docker 引擎支持。
40+
41+
<!--
3242
Check out [container runtimes](/docs/setup/production-environment/container-runtimes/)
3343
section to know your options. Make sure to
3444
[report issues](https://github.com/kubernetes/kubernetes/issues) you encountered
@@ -40,3 +50,41 @@ ready for dockershim removal.
4050
一节以了解可用的备选项。
4151
当在迁移过程中遇到麻烦,请[上报问题](https://github.com/kubernetes/kubernetes/issues)
4252
那么问题就可以及时修复,你的集群也可以进入移除 dockershim 前的就绪状态。
53+
54+
<!--
55+
Your cluster might have more than one kind of node, although this is not a common
56+
configuration.
57+
58+
These tasks will help you to migrate:
59+
60+
* [Check whether Dockershim deprecation affects you](/docs/tasks/administer-cluster/migrating-from-dockershim/check-if-dockershim-deprecation-affects-you/)
61+
* [Migrating from dockershim](/docs/tasks/administer-cluster/migrating-from-dockershim/)
62+
* [Migrating telemetry and security agents from dockershim](/docs/tasks/administer-cluster/migrating-from-dockershim/migrating-telemetry-and-security-agents/)
63+
-->
64+
你的集群中可以有不止一种类型的节点,尽管这不是常见的情况。
65+
66+
下面这些任务可以帮助你完成迁移:
67+
68+
* [检查弃用 Dockershim 对你的影响](/zh/docs/tasks/administer-cluster/migrating-from-dockershim/check-if-dockershim-deprecation-affects-you/)
69+
* [dockershim 迁移](/zh/docs/tasks/administer-cluster/migrating-from-dockershim/)
70+
* [从 dockershim 迁移遥测和安全代理](/zh/docs/tasks/administer-cluster/migrating-from-dockershim/migrating-telemetry-and-security-agents/)
71+
<!--
72+
## {{% heading "whatsnext" %}}
73+
74+
* Check out [container runtimes](/docs/setup/production-environment/container-runtimes/)
75+
to understand your options for a container runtime.
76+
* There is a
77+
[GitHub issue](https://github.com/kubernetes/kubernetes/issues/106917)
78+
to track discussion about the deprecation and removal of dockershim.
79+
* If you found a defect or other technical concern relating to migrating away from dockershim,
80+
you can [report an issue](https://github.com/kubernetes/kubernetes/issues/new/choose)
81+
to the Kubernetes project.
82+
-->
83+
84+
## 下一步
85+
86+
* 查看[容器运行时](/zh/docs/setup/production-environment/container-runtimes/)了解可选的容器运行时。
87+
* [GitHub 问题](https://github.com/kubernetes/kubernetes/issues/106917)跟踪有关 dockershim 的弃用和删除的讨论。
88+
* 如果你发现与 dockershim 迁移相关的缺陷或其他技术问题,
89+
可以在 Kubernetes 项目[报告问题](https://github.com/kubernetes/kubernetes/issues/new/choose)
90+

content/zh/docs/tasks/administer-cluster/migrating-from-dockershim/check-if-dockershim-deprecation-affects-you.md

Lines changed: 0 additions & 185 deletions
This file was deleted.

content/zh/docs/tasks/administer-cluster/migrating-from-dockershim/find-out-runtime-you-use.md

Lines changed: 104 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,34 @@ kubectl get nodes -o wide
5555
<!--
5656
The output is similar to the following. The column `CONTAINER-RUNTIME` outputs
5757
the runtime and its version.
58+
59+
For Docker Engine, the output is similar to this:
5860
-->
5961
输出如下面所示。`CONTAINER-RUNTIME` 列给出容器运行时及其版本。
6062

63+
对于 Docker Engine,输出类似于:
6164
```none
62-
# For dockershim
6365
NAME STATUS VERSION CONTAINER-RUNTIME
6466
node-1 Ready v1.16.15 docker://19.3.1
6567
node-2 Ready v1.16.15 docker://19.3.1
6668
node-3 Ready v1.16.15 docker://19.3.1
6769
```
70+
<!--
71+
If your runtime shows as Docker Engine, you still might not be affected by the
72+
removal of dockershim in Kubernetes 1.24. [Check the runtime
73+
endpoint](#which-endpoint) to see if you use dockershim. If you don't use
74+
dockershim, you aren't affected.
75+
76+
For containerd, the output is similar to this:
77+
-->
78+
79+
如果你的容器运行时显示为 Docker Engine,你仍然可能不会被 1.24 中 dockershim 的移除所影响。
80+
通过[检查运行时端点](#which-endpoint),可以查看你是否在使用 dockershim。
81+
如果你没有使用 dockershim,你就不会被影响。
82+
看下是否是使用的 dockershim,如何是 dockershim 则会受到在 Kubernetes 1.24 中移除 dockershim 的影响。
83+
反之则不会受到影响。
84+
85+
对于 containerd,输出类似于这样:
6886

6987
```none
7088
# For containerd
@@ -81,3 +99,88 @@ on [Container Runtimes](/docs/setup/production-environment/container-runtimes/)
8199
你可以在[容器运行时](/zh/docs/setup/production-environment/container-runtimes/)
82100
页面找到与容器运行时相关的更多信息。
83101

102+
<!--
103+
## Find out what container runtime endpoint you use {#which-endpoint}
104+
-->
105+
## 检查当前使用的运行时端点 {#which-endpoint}
106+
107+
<!--
108+
The container runtime talks to the kubelet over a Unix socket using the [CRI
109+
protocol](/docs/concepts/architecture/cri/), which is based on the gRPC
110+
framework. The kubelet acts as a client, and the runtime acts as the server.
111+
In some cases, you might find it useful to know which socket your nodes use. For
112+
example, with the removal of dockershim in Kubernetes 1.24 and later, you might
113+
want to know whether you use Docker Engine with dockershim.
114+
-->
115+
116+
容器运行时使用 Unix Socket 与 kubelet 通信,这一通信使用基于 gRPC 框架的
117+
[CRI 协议](/zh/docs/concepts/architecture/cri/)。kubelet 扮演客户端,运行时扮演服务器端。
118+
在某些情况下,你可能想知道你的节点使用的是哪个 socket。
119+
如若集群是 Kubernetes 1.24 及以后的版本,
120+
或许你想知道当前运行时是否是使用 dockershim 的 Docker Engine。
121+
122+
<!--
123+
{{<note>}}
124+
If you currently use Docker Engine in your nodes with `cri-dockerd`, you aren't
125+
affected by the dockershim removal.
126+
{{</note>}}
127+
-->
128+
129+
{{<note>}}
130+
如果你的节点在通过 `cri-dockerd` 使用 Docker Engine,
131+
那么集群不会受到 Kubernetes 移除 dockershim 的影响。
132+
{{</note>}}
133+
134+
<!--
135+
You can check which socket you use by checking the kubelet configuration on your
136+
nodes.
137+
-->
138+
可以通过检查 kubelet 的参数得知当前使用的是哪个 socket。
139+
140+
<!--
141+
1. Read the starting commands for the kubelet process:
142+
143+
```
144+
tr \\0 ' ' < /proc/"$(pgrep kubelet)"/cmdline
145+
```
146+
If you don't have `tr` or `pgrep`, check the command line for the kubelet
147+
process manually.
148+
-->
149+
1. 查看 kubelet 进程的启动命令
150+
151+
```
152+
tr \\0 ' ' < /proc/"$(pgrep kubelet)"/cmdline
153+
```
154+
如有节点上没有 `tr` 或者 `pgrep`,就需要手动检查 kubelet 的启动命令
155+
156+
<!--
157+
1. In the output, look for the `--container-runtime` flag and the
158+
`--container-runtime-endpoint` flag.
159+
160+
* If your nodes use Kubernetes v1.23 and earlier and these flags aren't
161+
present or if the `--container-runtime` flag is not `remote`,
162+
you use the dockershim socket with Docker Engine.
163+
* If the `--container-runtime-endpoint` flag is present, check the socket
164+
name to find out which runtime you use. For example,
165+
`unix:///run/containerd/containerd.sock` is the containerd endpoint.
166+
-->
167+
2. 在命令的输出中,查找 `--container-runtime``--container-runtime-endpoint` 标志。
168+
169+
* 如果 Kubernetes 集群版本是 v1.23 或者更早的版本,并且这两个参数不存在,
170+
或者 `container-runtime` 标志值不是 `remote`,则你在通过 dockershim 套接字使用
171+
Docker Engine。
172+
或者如果集群使用的 Docker engine 和 dockershim socket,则输出结果中 `--container-runtime` 不是 `remote`,
173+
* 如果设置了 `--container-runtime-endpoint` 参数,查看套接字名称即可得知当前使用的运行时。
174+
如若套接字 `unix:///run/containerd/containerd.sock` 是 containerd 的端点。
175+
176+
<!--
177+
If you want to change the Container Runtime on a Node from Docker Engine to containerd,
178+
you can find out more information on [migrate to a different runtime](/docs/tasks/administer-cluster/migrating-from-dockershim/change-runtime-containerd/),
179+
or, if you want to continue using Docker Engine in v1.24 and later, migrate to a
180+
CRI-compatible adapter like [`cri-dockerd`](https://github.com/Mirantis/cri-dockerd).
181+
-->
182+
如果想将节点上的容器运行时从 Docker Engine 切换成 containerd,可在
183+
[Docker Engine 迁移到 containerd](zh/docs/tasks/administer-cluster/migrating-from-dockershim/change-runtime-containerd/)
184+
找到更多信息。或者,如果你想在 Kubernetes v1.24 及以后的版本仍使用 Docker Engine,
185+
可以安装 CRI 兼容的适配器实现,如 [`cri-dockerd`](https://github.com/Mirantis/cri-dockerd)
186+
[`cri-dockerd`](https://github.com/Mirantis/cri-dockerd)

0 commit comments

Comments
 (0)