k8s修改运行时 从docker切换成containerd
停止相关服务
systemctl stop kubelet
systemctl stop docker
systemctl stop containerd
cp /etc/containerd/config.toml /srv/
containerd config default > /etc/containerd/config.toml
# /etc/containerd/config.toml 修改containerd的存储路径 root = "/data1/containerd"
# 里面有个镜像需要改k8s.gcr.io/pause:3.2 --> harbor.deepwise.com/terra-k8s/pause:3.2
# 确认一下/etc/resolv.conf是否为内网配置 能ping的harbor域名
岛入所需镜像
ctr image import /data1/new-terra-scripts/images/all_base_images.tar.gz
ctr i tag harbor.deepwise.com/terra-k8s/pause:3.2 k8s.gcr.io/pause:3.2
修改kubelet的启动参数
# 修改启动参数/lib/systemd/system/kubelet.service
--container-runtime=remote --container-runtime-endpoint=/run/containerd/containerd.sock --cgroup-driver=systemd
journalctl -f -u containerd