天天看點

[kubernetes]-k8s修改運作時 從docker切換成containerd

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
           
[kubernetes]-k8s修改運作時 從docker切換成containerd