1.下载
- Github https://github.com/containerd/containerd/releases/download/v1.6.6/cri-containerd-cni-1.6.6-linux-amd64.tar.gz
2.配置
- 1.在
/usr/local/
下创建containerd
文件夹,将解压后的usr/local
文件夹下的bin、sbin
复制到/usr/local/containerd
文件夹下,然后配置环境变量,配置完毕后执行source /etc/profile
,执行runc --help
和containerd --help
测试,如有输出证明配置成功。
export CONTAINERD_HOME=/usr/local/containerd
export PATH=$CONTAINERD_HOME/bin:$CONTAINERD_HOME/sbin:$PATH
- 2.创建
/etc/containerd
文件夹,修改配置文件,执行containerd config default > /etc/containerd/config.toml
,修改SystemdCgroup = true
,添加镜像源https://5r6sntk6.mirror.aliyuncs.com
。
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes]
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
base_runtime_spec = ""
cni_conf_dir = ""
cni_max_conf_num = 0
container_annotations = []
pod_annotations = []
privileged_without_host_devices = false
runtime_engine = ""
runtime_path = ""
runtime_root = ""
runtime_type = "io.containerd.runc.v2"
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
BinaryName = ""
CriuImagePath = ""
CriuPath = ""
CriuWorkPath = ""
IoGid = 0
IoUid = 0
NoNewKeyring = false
NoPivotRoot = false
Root = ""
ShimCgroup = ""
SystemdCgroup = true
[plugins."io.containerd.grpc.v1.cri".containerd.untrusted_workload_runtime]
base_runtime_spec = ""
cni_conf_dir = ""
cni_max_conf_num = 0
container_annotations = []
pod_annotations = []
privileged_without_host_devices = false
runtime_engine = ""
runtime_path = ""
runtime_root = ""
runtime_type = ""
[plugins."io.containerd.grpc.v1.cri".containerd.untrusted_workload_runtime.options]
[plugins."io.containerd.grpc.v1.cri".image_decryption]
key_model = "node"
[plugins."io.containerd.grpc.v1.cri".registry]
config_path = ""
[plugins."io.containerd.grpc.v1.cri".registry.auths]
[plugins."io.containerd.grpc.v1.cri".registry.configs]
[plugins."io.containerd.grpc.v1.cri".registry.headers]
[plugins."io.containerd.grpc.v1.cri".registry.mirrors]
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"]
endpoint = ["https://5r6sntk6.mirror.aliyuncs.com"]
-
3.将
etc/systemd/system
文件夹下的containerd.service
复制到/usr/lib/systemd/system/
文件夹下,修改ExecStart=/usr/local/containerd/bin/containerd
,保存后退出。 -
4.启动服务
systemctl daemon-reload
systemctl enable containerd
systemctl start containerd
原创文章,作者:,如若转载,请注明出处:https://blog.ytso.com/267078.html