安装containerd
apt/yum安装
#验证仓库版本
[root@k8s-node3 ~]#apt-cache madison containerd
containerd | 1.7.12-0ubuntu2~22.04.1 | https://mirrors.aliyun.com/ubuntu jammy-updates/main amd64 Packages
containerd | 1.6.12-0ubuntu1~22.04.3 | https://mirrors.aliyun.com/ubuntu jammy-security/main amd64 Packages
containerd | 1.5.9-0ubuntu3 | https://mirrors.aliyun.com/ubuntu jammy/main amd64 Packages
containerd | 1.5.9-0ubuntu3 | https://mirrors.aliyun.com/ubuntu jammy/main Sources
containerd | 1.6.12-0ubuntu1~22.04.6 | https://mirrors.aliyun.com/ubuntu jammy-security/main Sources
containerd | 1.6.12-0ubuntu1~22.04.6 | https://mirrors.aliyun.com/ubuntu jammy-updates/main Sources
containerd-app | 1.7.12-0ubuntu2~22.04.1 | https://mirrors.aliyun.com/ubuntu jammy-updates/universe Sources
#安装containerd:
[root@k8s-node3 apt]#apt -y install containerd=1.6.12-0ubuntu1~22.04.3
#查看service⽂件:
[root@k8s-node3 ~]#cat /lib/systemd/system/containerd.service
#验证runc环境:
root@containerd-server1:~# whereis runc
runc: /usr/sbin/runc /usr/share/man/man8/runc.8.gz
root@containerd-server1:~#
root@containerd-server1:~# whereis containerd
containerd: /usr/bin/containerd /usr/share/man/man8/containerd.8.gz
root@containerd-server1:~#
root@containerd-server1:~# runc -v
runc version 1.1.12-0ubuntu2~22.04.1
spec: 1.0.2-dev
go: go1.21.1
libseccomp: 2.5.3
[root@k8s-node3 ~]#containerd -v
containerd github.com/containerd/containerd 1.6.12-0ubuntu1~22.04.3
#containerd配置⽂件:
root@containerd-server1:~# containerd --help
root@containerd-server1:~# containerd config --help
root@containerd-server1:~# containerd config default #查看默认配置
root@containerd-server1:~# mkdir /etc/containerd/
root@containerd-server1:~# containerd config default > /etc/containerd/config.toml
root@containerd-server1:~# systemctl restart containerd.servicecontainerd配置⽂件:
#containerd 下载镜像的路径(可替换成能下载的镜像)
[root@k8s-node3 ~]#vim /etc/containerd/config.toml
sandbox_image = "registry.k8s.io/pause:3.6"
(国内阿里云)
registry.cn-hangzhou.aliyuncs.com/google_containers/pause:3.9
#重启镜像
[root@k8s-node3 ~]#systemctl restart containerd.service
#通过命令⾏测试下载镜像:
containerd的命令⾏客户端有ctr、crictl、nerdctl等,containerd相⽐d