Kubernetes 初始化报错[ERROR CRI]: container runtime is not running:
  aOYB9Qh7rxCg 2023年11月02日 81 0

在linux上安装Kubernetes,初始化时报错:

[root@k8s-master ~]# kubeadm init \
> --apiserver-advertise-address=10.10.10.180 \
> --image-repository registry.aliyuncs.com/google_containers \
> --kubernetes-version v1.28.1 \
> --service-cidr=10.10.10.0/24 \
> --pod-network-cidr=10.10.11.0/24 \
> --service-dns-domain=cluster.local \
> --ignore-preflight-errors=Swap \
> --ignore-preflight-errors=NumCPU
[init] Using Kubernetes version: v1.28.1
[preflight] Running pre-flight checks
error execution phase preflight: [preflight] Some fatal errors occurred:
	[ERROR CRI]: container runtime is not running: output: time="2023-09-08T11:35:06+08:00" level=fatal msg="validate service connection: CRI v1 runtime API is not implemented for endpoint \"unix:///var/run/containerd/containerd.sock\": rpc error: code = Unimplemented desc = unknown service runtime.v1.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 ~]# rm -rf /etc/containerd/config.toml
[root@k8s-master ~]# systemctl restart containerd
# 完成后重新初始化,通过
[root@k8s-master ~]# kubeadm init --apiserver-advertise-address=10.10.10.180 --image-repository registry.aliyuncs.com/google_containers --kubernetes-version v1.28.1 --service-cidr=10.10.10.0/24 --pod-network-cidr=10.10.11.0/24 --service-dns-domain=cluster.local --ignore-preflight-errors=Swap --ignore-preflight-errors=NumCPU
[init] Using Kubernetes version: v1.28.1
[preflight] Running pre-flight checks
[preflight] Pulling images required for setting up a Kubernetes cluster
[preflight] This might take a minute or two, depending on the speed of your internet connection
[preflight] You can also perform this action in beforehand using 'kubeadm config images pull'
【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月08日 0

暂无评论

推荐阅读
aOYB9Qh7rxCg