在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'
标签:errors,container,Kubernetes,service,--,报错,10.10,preflight,runtime
From: https://blog.51cto.com/u_1264026/7408230