Kubernetes容器运行时-Containerd常用操作

本文介绍:最近Kubernetes1.24版本发布了,随之去除了docker-shim组件,容器运行时改为containerd,所以打算发布以下containerd在k8s中常用操作

Containerd作为容器运行时可以用的指令

可以使用的指令包括ctr、crictl、nerdctl,其中ctr是安装containerd自带的可执行指令,crictl、nerdctl命令是比较接近docker命令,也是社区所提供的

Containerd常用命令

1.查看容器运行状态

# 1.ctr
ctr container ls
#指定命名空间
ctr --namespace=k8s.io container ls

# 2.crictl
crictl ps

# 3.nerdctl
nerdctl ps

2.查看镜像

# 1.ctr
ctr image ls
#指定命名空间
ctr --namespace=k8s.io image ls

# 2.crictl
crictl image

# 3.nerdctl
nerdctl image

3.查看容器日志

# 1.ctr
没有相关命令

# 2.crictl
crictl logs

# 3.nerdctl
nerdctl logs

4.修改镜像标签

# 1.ctr
ctr image tag

# 2.crictl
没有相关命令

# 3.nerdctl
nerdctl tag

5.导出镜像

# 1.ctr
ctr image export

# 2. crictl
没有相关命令

# 3.nerdctl
nerdctl save

6.导入镜像

# 1.ctl
ctr image import

# 2.crictl
没有相关命令

# 3.nerdctl
nerdctl load

7.删除镜像

# 1.ctr
ctr image rm

# 2.crictl
crictl rmi

#3. nerdctl
nerdctl rmi

8.拉取镜像

# 1.ctr
ctr image pull

# 2.crictl
crictl pull

# 3.nerdctl
nerdctl pull

9.推送镜像

# 1.ctr
ctr image push

# 2.crictl
没有相关命令

# 3.nerdctl
nerdctl push

以上是containerd在k8s中常用操作。

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值