Skip to content

Commit 66b403b

Browse files
committed
[zh] resync page check-if-dockershim-removal-affects-you
1 parent 68750e7 commit 66b403b

File tree

1 file changed

+94
-15
lines changed

1 file changed

+94
-15
lines changed

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

Lines changed: 94 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: 检查移除 Dockershim 是否对你有影响
3-
content_type: task
3+
content_type: task
44
weight: 50
55
---
66
<!--
@@ -13,7 +13,7 @@ weight: 50
1313

1414
<!-- overview -->
1515

16-
<!--
16+
<!--
1717
The `dockershim` component of Kubernetes allows the use of Docker as a Kubernetes's
1818
{{< glossary_tooltip text="container runtime" term_id="container-runtime" >}}.
1919
Kubernetes' built-in `dockershim` component was removed in release v1.24.
@@ -23,7 +23,7 @@ Kubernetes 的 `dockershim` 组件使得你可以把 Docker 用作 Kubernetes
2323
{{< glossary_tooltip text="容器运行时" term_id="container-runtime" >}}。
2424
在 Kubernetes v1.24 版本中,内建组件 `dockershim` 被移除。
2525

26-
<!--
26+
<!--
2727
This page explains how your cluster could be using Docker as a container runtime,
2828
provides details on the role that `dockershim` plays when in use, and shows steps
2929
you can take to check whether any workloads could be affected by `dockershim` removal.
@@ -32,20 +32,20 @@ you can take to check whether any workloads could be affected by `dockershim` re
3232
并提供使用 `dockershim` 时,它所扮演角色的详细信息,
3333
继而展示了一组操作,可用来检查移除 `dockershim` 对你的工作负载是否有影响。
3434

35-
<!--
35+
<!--
3636
## Finding if your app has a dependencies on Docker {#find-docker-dependencies}
3737
-->
3838
## 检查你的应用是否依赖于 Docker {#find-docker-dependencies}
3939

40-
<!--
40+
<!--
4141
If you are using Docker for building your application containers, you can still
4242
run these containers on any container runtime. This use of Docker does not count
4343
as a dependency on Docker as a container runtime.
4444
-->
4545
即使你是通过 Docker 创建的应用容器,也不妨碍你在其他任何容器运行时上运行这些容器。
4646
这种使用 Docker 的方式并不构成对 Docker 作为一个容器运行时的依赖。
4747

48-
<!--
48+
<!--
4949
When alternative container runtime is used, executing Docker commands may either
5050
not work or yield unexpected output. This is how you can find whether you have a
5151
dependency on Docker:
@@ -94,12 +94,12 @@ dependency on Docker:
9494
或者在故障排查指令的一个环节中搜索特定的日志信息。
9595
如果你有此类配置的工具,需要在迁移之前,在测试集群上测试这类行为。
9696

97-
<!--
98-
## Dependency on Docker explained {#role-of-dockershim}
97+
<!--
98+
## Dependency on Docker explained {#role-of-dockershim}
9999
-->
100100
## Docker 依赖详解 {#role-of-dockershim}
101101

102-
<!--
102+
<!--
103103
A [container runtime](/docs/concepts/containers/#container-runtimes) is software that can
104104
execute the containers that make up a Kubernetes pod. Kubernetes is responsible for orchestration
105105
and scheduling of Pods; on each node, the {{< glossary_tooltip text="kubelet" term_id="kubelet" >}}
@@ -111,7 +111,7 @@ container runtime.
111111
Kubernetes 负责编排和调度 Pod;在每一个节点上,{{< glossary_tooltip text="kubelet" term_id="kubelet" >}}
112112
使用抽象的容器运行时接口,所以你可以任意选用兼容的容器运行时。
113113

114-
<!--
114+
<!--
115115
In its earliest releases, Kubernetes offered compatibility with one container runtime: Docker.
116116
Later in the Kubernetes project's history, cluster operators wanted to adopt additional container runtimes.
117117
The CRI was designed to allow this kind of flexibility - and the kubelet began supporting CRI. However,
@@ -125,7 +125,7 @@ if Docker were a CRI compatible runtime.
125125
然而,因为 Docker 在 CRI 规范创建之前就已经存在,Kubernetes 就创建了一个适配器组件 `dockershim`
126126
dockershim 适配器允许 kubelet 与 Docker 交互,就好像 Docker 是一个 CRI 兼容的运行时一样。
127127

128-
<!--
128+
<!--
129129
You can read about it in [Kubernetes Containerd integration goes GA](/blog/2018/05/24/kubernetes-containerd-integration-goes-ga/) blog post.
130130
-->
131131
你可以阅读博文
@@ -136,7 +136,7 @@ You can read about it in [Kubernetes Containerd integration goes GA](/blog/2018/
136136
-->
137137
![Dockershim 和 Containerd CRI 的实现对比图](/images/blog/2018-05-24-kubernetes-containerd-integration-goes-ga/cri-containerd.png)
138138

139-
<!--
139+
<!--
140140
Switching to Containerd as a container runtime eliminates the middleman. All the
141141
same containers can be run by container runtimes like Containerd as before. But
142142
now, since containers schedule directly with the container runtime, they are not visible to Docker.
@@ -148,7 +148,7 @@ before to check on these containers is no longer available.
148148
但是现在,由于直接用容器运行时调度容器,它们对 Docker 是不可见的。
149149
因此,你以前用来检查这些容器的 Docker 工具或漂亮的 UI 都不再可用。
150150

151-
<!--
151+
<!--
152152
You cannot get container information using `docker ps` or `docker inspect`
153153
commands. As you cannot list containers, you cannot get logs, stop containers,
154154
or execute something inside a container using `docker exec`.
@@ -166,7 +166,7 @@ for all container runtimes, not only Docker).
166166
而不是通过容器运行时来停止它们(此建议适用于所有容器运行时,不仅仅是针对 Docker)。
167167
{{< /note >}}
168168

169-
<!--
169+
<!--
170170
You can still pull images or build them using `docker build` command. But images
171171
built or pulled by Docker would not be visible to container runtime and
172172
Kubernetes. They needed to be pushed to some registry to allow them to be used
@@ -176,6 +176,86 @@ by Kubernetes.
176176
但用 Docker 创建、下载的镜像,对于容器运行时和 Kubernetes,均不可见。
177177
为了在 Kubernetes 中使用,需要把镜像推送(push)到某镜像仓库。
178178

179+
<!--
180+
## Known issues
181+
-->
182+
## 已知问题 {#known-issues}
183+
184+
<!--
185+
### Some filesystem metrics are missing and the metrics format is different
186+
-->
187+
### 一些文件系统指标缺失并且指标格式不同 {#some-filesystem-metrics-are-missing-and-the-metrics-format-is-different}
188+
189+
<!--
190+
The Kubelet `/metrics/cadvisor` endpoint provides Prometheus metrics,
191+
as documented in [Metrics for Kubernetes system components](/docs/concepts/cluster-administration/system-metrics/).
192+
If you install a metrics collector that depends on that endpoint, you might see the following issues:
193+
-->
194+
Kubelet `/metrics/cadvisor` 端点提供 Prometheus 指标,
195+
[Kubernetes 系统组件指标](/zh-cn/docs/concepts/cluster-administration/system-metrics/) 中所述。
196+
如果你安装了一个依赖该端点的指标收集器,你可能会看到以下问题:
197+
198+
<!--
199+
- The metrics format on the Docker node is `k8s_<container-name>_<pod-name>_<namespace>_<pod-uid>_<restart-count>`
200+
but the format on other runtime is different. For example, on containerd node it is `<container-id>`.
201+
- Some filesystem metrics are missing, as follows:
202+
-->
203+
- Docker 节点上的指标格式为 `k8s_<container-name>_<pod-name>_<namespace>_<pod-uid>_<restart-count>`
204+
但其他运行时的格式不同。例如,在 containerd 节点上它是 `<container-id>`
205+
- 一些文件系统指标缺失,如下所示:
206+
207+
```
208+
container_fs_inodes_free
209+
container_fs_inodes_total
210+
container_fs_io_current
211+
container_fs_io_time_seconds_total
212+
container_fs_io_time_weighted_seconds_total
213+
container_fs_limit_bytes
214+
container_fs_read_seconds_total
215+
container_fs_reads_merged_total
216+
container_fs_sector_reads_total
217+
container_fs_sector_writes_total
218+
container_fs_usage_bytes
219+
container_fs_write_seconds_total
220+
container_fs_writes_merged_total
221+
```
222+
223+
<!--
224+
#### Workaround
225+
-->
226+
#### 解决方法 {#workaround}
227+
228+
<!--
229+
You can mitigate this issue by using [cAdvisor](http://github.com/google/cadvisor) as a standalone daemonset.
230+
-->
231+
你可以通过使用 [cAdvisor](http://github.com/google/cadvisor) 作为一个独立的守护程序来缓解这个问题。
232+
233+
<!--
234+
1. Find the latest [cAdvisor release](http://github.com/google/cadvisor/releases)
235+
with the name pattern `vX.Y.Z-containerd-cri` (for example, `v0.42.0-containerd-cri`).
236+
2. Follow the steps in [cAdvisor Kubernetes Daemonset](http://github.com/google/cadvisor/tree/master/deploy/kubernetes) to create the daemonset.
237+
3. Point the installed metrics collector to use the cAdvisor `/metrics` endpoint
238+
which provides the full set of
239+
[Prometheus container metrics](http://github.com/google/cadvisor/blob/master/docs/storage/prometheus.md).
240+
-->
241+
1. 找到名称格式为 `vX.Y.Z-containerd-cri` 的最新
242+
[cAdvisor 版本](http://github.com/google/cadvisor/releases)(例如 `v0.42.0-containerd-cri`)。
243+
2. 按照 [cAdvisor Kubernetes Daemonset](http://github.com/google/cadvisor/tree/master/deploy/kubernetes)
244+
中的步骤来创建守护进程。
245+
3. 将已安装的指标收集器指向使用 cAdvisor 的 `/metrics` 端点。
246+
该端点提供了全套的 [Prometheus 容器指标](http://github.com/google/cadvisor/blob/master/docs/storage/prometheus.md)
247+
248+
<!--
249+
Alternatives:
250+
251+
- Use alternative third party metrics collection solution.
252+
- Collect metrics from the Kubelet summary API that is served at `/stats/summary`.
253+
-->
254+
替代方案:
255+
256+
- 使用替代的第三方指标收集解决方案。
257+
- 从 Kubelet 摘要 API 收集指标,该 API 在 `/stats/summary` 提供服务。
258+
179259
## {{% heading "whatsnext" %}}
180260

181261
<!--
@@ -185,4 +265,3 @@ by Kubernetes.
185265
- 阅读[从 dockershim 迁移](/zh-cn/docs/tasks/administer-cluster/migrating-from-dockershim/)
186266
以了解你的下一步工作。
187267
- 阅读[弃用 Dockershim 的常见问题](/zh-cn/blog/2020/12/02/dockershim-faq/),了解更多信息。
188-

0 commit comments

Comments
 (0)