Kubeadm初始化报错:[ERROR CRI]: container runtime is not running: output:

在初始化kubeadm的时候出现了如下错误:

[root@centos7-1 ~]# sudo kubeadm init

[init] Using Kubernetes version: v1.26.0
[preflight] Running pre-flight checks
    [WARNING Firewalld]: firewalld is active, please ensure ports [6443 10250] are open or your cluster may not function correctly
    [WARNING Swap]: swap is enabled; production deployments should disable swap unless testing the NodeSwap feature gate of the kubelet
    [WARNING Hostname]: hostname "centos7-1" could not be reached
    [WARNING Hostname]: hostname "centos7-1": lookup centos7-1 on 192.168.3.2:53: no such host
    [WARNING Service-Kubelet]: kubelet service is not enabled, please run 'systemctl enable kubelet.service'
error execution phase preflight: [preflight] Some fatal errors occurred:
    [ERROR CRI]: container runtime is not running: output: E1222 04:36:50.586954   20582 remote_runtime.go:948] "Status from runtime service failed" err="rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService"
time="2022-12-22T04:36:50-05:00" level=fatal msg="getting status of runtime: rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService"
, error: exit status 1
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
To see the stack trace of this error execute with --v=5 or higher

按照如下命令进行操作

[root@centos7-1 ~]# rm -rf /etc/containerd/config.toml 
[root@centos7-1 ~]# systemctl restart containerd

然后再次执行初始化就可以了

[root@centos7-1 ~]# sudo kubeadm init

OK了!

 

posted @ 2022-12-22 17:41  Old·Artist  阅读(2208)  评论(0编辑  收藏  举报