@@ -55,16 +55,34 @@ kubectl get nodes -o wide
55
55
<!--
56
56
The output is similar to the following. The column `CONTAINER-RUNTIME` outputs
57
57
the runtime and its version.
58
+
59
+ For Docker Engine, the output is similar to this:
58
60
-->
59
61
输出如下面所示。` CONTAINER-RUNTIME ` 列给出容器运行时及其版本。
60
62
63
+ 对于 Docker Engine,输出类似于:
61
64
``` none
62
- # For dockershim
63
65
NAME STATUS VERSION CONTAINER-RUNTIME
64
66
node-1 Ready v1.16.15 docker://19.3.1
65
67
node-2 Ready v1.16.15 docker://19.3.1
66
68
node-3 Ready v1.16.15 docker://19.3.1
67
69
```
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,输出类似于这样:
68
86
69
87
``` none
70
88
# For containerd
@@ -81,3 +99,88 @@ on [Container Runtimes](/docs/setup/production-environment/container-runtimes/)
81
99
你可以在[ 容器运行时] ( /zh/docs/setup/production-environment/container-runtimes/ )
82
100
页面找到与容器运行时相关的更多信息。
83
101
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