2019-05-21 22:05:06 +08:00
|
|
|
|
# containerd 容器运行时
|
|
|
|
|
|
|
|
|
|
作为 CNCF 毕业项目,containerd 致力于提供简洁、可靠、可扩展的容器运行时;它被设计用来集成到 kubernetes 等系统使用,而不是像 docker 那样独立使用。
|
|
|
|
|
|
|
|
|
|
- 安装指南 https://github.com/containerd/cri/blob/master/docs/installation.md
|
|
|
|
|
- 客户端 circtl 使用指南 https://github.com/containerd/cri/blob/master/docs/crictl.md
|
|
|
|
|
- man 文档 https://github.com/containerd/containerd/tree/master/docs/man
|
|
|
|
|
|
|
|
|
|
## kubeasz 集成安装 containerd
|
|
|
|
|
|
2021-01-25 00:02:45 +08:00
|
|
|
|
- 安装前修改配置文件,在clusters/xxxx/hosts 中修改全局变量 `CONTAINER_RUNTIME="containerd"`
|
|
|
|
|
- 其他正常执行安装即可:分步安装`ezctl setup xxxx 03`,一键安装`ezctl setup xxxx all`
|
|
|
|
|
|
|
|
|
|
## 命令对比
|
|
|
|
|
|
|
|
|
|
|命令 |docker |crictl(推荐) |ctr |
|
|
|
|
|
|:- |:- |:- |:- |
|
|
|
|
|
|查看容器列表 |docker ps |crictl ps |ctr -n k8s.io c ls |
|
|
|
|
|
|查看容器详情 |docker inspect |crictl inspect |ctr -n k8s.io c info |
|
|
|
|
|
|查看容器日志 |docker logs |crictl logs |无 |
|
|
|
|
|
|容器内执行命令 |docker exec |crictl exec |无 |
|
|
|
|
|
|挂载容器 |docker attach |crictl attach |无 |
|
|
|
|
|
|容器资源使用 |docker stats |crictl stats |无 |
|
|
|
|
|
|创建容器 |docker create |crictl create |ctr -n k8s.io c create |
|
|
|
|
|
|启动容器 |docker start |crictl start |ctr -n k8s.io run |
|
|
|
|
|
|停止容器 |docker stop |crictl stop |无 |
|
|
|
|
|
|删除容器 |docker rm |crictl rm |ctr -n k8s.io c del |
|
|
|
|
|
|查看镜像列表 |docker images |crictl images |ctr -n k8s.io i ls |
|
|
|
|
|
|查看镜像详情 |docker inspect |crictl inspecti|无 |
|
|
|
|
|
|拉取镜像 |docker pull |crictl pull |ctr -n k8s.io i pull |
|
|
|
|
|
|推送镜像 |docker push |无 |ctr -n k8s.io i push |
|
|
|
|
|
|删除镜像 |docker rmi |crictl rmi |ctr -n k8s.io i rm |
|
|
|
|
|
|查看Pod列表 |无 |crictl pods |无 |
|
|
|
|
|
|查看Pod详情 |无 |crictl inspectp|无 |
|
|
|
|
|
|启动Pod |无 |crictl runp |无 |
|
|
|
|
|
|停止Pod |无 |crictl stopp |无 |
|