From 4465ba00af46494d02365102ef4c71c43ef1f9a7 Mon Sep 17 00:00:00 2001 From: chenxuc Date: Sun, 31 Jan 2021 13:09:33 +0800 Subject: [PATCH] [zh] Sync web page for crictl This is part of the work in the following umbrella issue: [zh] Umbrella issue: pages out of sync in tasks section CRICTL (L) content/zh/docs/tasks/debug-application-cluster/crictl.md --- .../tasks/debug-application-cluster/crictl.md | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) diff --git a/content/zh/docs/tasks/debug-application-cluster/crictl.md b/content/zh/docs/tasks/debug-application-cluster/crictl.md index 0ccbba1828..f8e126f281 100644 --- a/content/zh/docs/tasks/debug-application-cluster/crictl.md +++ b/content/zh/docs/tasks/debug-application-cluster/crictl.md @@ -454,3 +454,124 @@ for more information. --> 更多信息请参考 [kubernetes-sigs/cri-tools](https://github.com/kubernetes-sigs/cri-tools)。 + +## Docker CLI 和 crictl 的映射 + + +以下的映射表格只适用于 Docker CLI v1.40 和 crictl v1.19.0 版本。 +请注意该表格并不详尽。例如,其中不包含 Docker CLI 的实验性命令。 + + +{{< note >}} +尽管有些命令的输出缺少了一些数据列,CRICTL 的输出格式与 Docker CLI 是类似的。 +如果你的脚本程序需要解析命令的输出,请确认检查该特定命令的输出。 +{{< /note >}} + + +### 获取调试信息 + +{{< table caption="Docker CLI 和 crictl 的映射 - 获取调试信息" >}} + +docker cli | crictl | 描述 | 不支持的功能 +-- | -- | -- | -- +`attach` | `attach` | 连接到一个运行中的容器 | `--detach-keys`, `--sig-proxy` +`exec` | `exec` | 在运行中的容器里运行一个命令 | `--privileged`, `--user`, `--detach-keys` +`images` | `images` | 列举镜像 |   +`info` | `info` | 显示系统级的信息 |   +`inspect` | `inspect`, `inspecti` | 返回容器、镜像或者任务的详细信息 |   +`logs` | `logs` | 获取容器的日志 | `--details` +`ps` | `ps` | 列举容器 |   +`stats` | `stats` | 实时显示容器的资源使用统计信息 | 列:NET/BLOCK I/O, PIDs +`version` | `version` | 显示运行时(Docker、ContainerD、或者其他) 的版本信息 |   +{{< /table >}} + + +### 进行改动 + +{{< table caption="Docker CLI 和 crictl 的映射 - 进行改动" >}} + +docker cli | crictl | 描述 | 不支持的功能 +-- | -- | -- | -- +`create` | `create` | 创建一个新的容器 |   +`kill` | `stop` (timeout=0) | 杀死一个或多个正在运行的容器 | `--signal` +`pull` | `pull` | 从镜像仓库拉取镜像或者代码仓库 | `--all-tags`, `--disable-content-trust` +`rm` | `rm` | 移除一个或多个容器 |   +`rmi` | `rmi` | 移除一个或多个镜像 |   +`run` | `run` | 在新容器里运行一个命令 |   +`start` | `start` | 启动一个或多个停止的容器 | `--detach-keys` +`stop` | `stop` | 停止一个或多个正运行的容器 |   +`update` | `update` | 更新一个或多个容器的配置 | CRI 不支持 `--restart`、`--blkio-weight` 以及一些其他的资源限制选项。 +{{< /table >}} + + +### 仅 crictl 支持 + +{{< table caption="Docker CLI 和 crictl 的映射 - 仅 crictl 支持" >}} + +crictl | 描述 +-- | -- +`imagefsinfo` | 返回镜像的文件系统信息 +`inspectp` | 显示一个或多个 Pod 的状态 +`port-forward` | 转发本地端口到 Pod +`pods` | 列举 Pod +`runp` | 运行一个新的 Pod +`rmp` | 移除一个或多个 Pod +`stopp` | 停止一个或多个正运行的 Pod +{{< /table >}}