kubeadm init 报错 ”unknown service runtime.v1alpha2.RuntimeService”
在kubernetes master节点初始化的时候报错
[root@k8s-master opt]# kubeadm init --kubernetes-version=1.24.0 --apiserver-advertise-address=10.0.0.215 --image-repository 10.0.0.200:80/google_containers --service-cidr=10.96.0.0/12 --pod-network-cidr=10.244.0.0/16 --ignore-preflight-errors=Swap
[init] Using Kubernetes version: v1.24.0
[preflight] Running pre-flight checks
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR CRI]: container runtime is not running: output: time="2022-05-18T11:36:02+08: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@k8s-master opt]# rm /etc/containerd/config.toml
[root@k8s-master opt]# systemctl restart containerd
再次执行:
kubeadm init --kubernetes-version=1.24.0 --apiserver-advertise-address=10.0.0.215 --image-repository 10.0.0.200:80/google_containers --service-cidr=10.96.0.0/12 --pod-network-cidr=10.244.0.0/16 --ignore-preflight-errors=Swap
成功!!!!!!!!!