Loading

【k8s】kubeadm init 时报错 unknown service runtime.v1alpha2.RuntimeService

在测试机器中准备搭建 k8s 集群,在 master 节点执行 kubeadm init 时出现报错,unknown service runtime.v1alpha2.RuntimeService,此文主要记录一下处理方法。

问题描述

报错信息如下:

root@master:/home/ubuntu# kubeadm init
[init] Using Kubernetes version: v1.25.1
[preflight] Running pre-flight checks
error execution phase preflight: [preflight] Some fatal errors occurred:
	[ERROR CRI]: container runtime is not running: output: E0921 16:19:51.445411    1088 remote_runtime.go:948] "Status from runtime service failed" err="rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService"
time="2022-09-21T16:19:51+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

解决方法

删除 /etc/containerd/config.toml 文件并重启 containerd 即可。

mv /etc/containerd/config.toml /root/config.toml.bak

systemctl restart containerd

再次执行 kubeadm init 命令,发现已经 ok 了。


关注 max,每天学会一个写 Bug 小技巧。

posted @ 2022-09-23 02:31  immaxfang  阅读(5042)  评论(0编辑  收藏  举报