当前位置: 首页 > ai >正文

k8s初始化时候,报错无法通过 CRI(容器运行时接口)与 containerd 通信

报错主要信息处
[reset] Unmounting mounted directories in “/var/lib/kubelet”
W0513 11:34:19.818023 27124 cleanupnode.go:134] [reset] Failed to evaluate the “/var/lib/kubelet” directory. Skipping its unmount and cleanup: lstat /var/lib/kubelet: no such file or directory
W0513 11:34:19.837582 27124 cleanupnode.go:99] [reset] Failed to remove containers: output: time=“2025-05-13T11:34:19+08:00” level=fatal msg=“validate service connection: validate CRI v1 runtime API for endpoint “unix:///run/containerd/containerd.sock”: rpc error: code = Unimplemented desc = unknown service runtime.v1.RuntimeService”
, error: exit status 1
[reset] Deleting contents of directories: [/etc/kubernetes/manifests /etc/kubernetes/pki]
[reset] Deleting files: [/etc/kubernetes/admin.conf /etc/kubernetes/kubelet.conf /etc/kubernetes/bootstrap-kubelet.conf /etc/kubernetes/controller-manager.conf /etc/kubernetes/scheduler.conf]

The reset process does not clean CNI configuration. To do so, you must remove /etc/cni/net.d

The reset process does not reset or clean up iptables rules or IPVS tables.
If you wish to reset iptables, you must do so manually by using the “iptables” command.

If your cluster was setup to utilize IPVS, run ipvsadm --clear (or similar)
to reset your system’s IPVS tables.

The reset process does not clean your kubeconfig files and you must remove them manually.
Please, check the contents of the $HOME/.kube/config file.
11:34:19 CST message: [node1]
init kubernetes cluster failed: Failed to exec command: sudo -E /bin/bash -c “/usr/local/bin/kubeadm init --config=/etc/kubernetes/kubeadm-config.yaml --ignore-preflight-errors=FileExisting-crictl,ImagePull”
W0513 11:34:19.641213 27083 utils.go:69] The recommended value for “clusterDNS” in “KubeletConfiguration” is: [10.233.0.10]; the provided value is: [169.254.25.10]
[init] Using Kubernetes version: v1.26.0
[preflight] Running pre-flight checks
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR CRI]: container runtime is not running: output: time=“2025-05-13T11:34:19+08:00” level=fatal msg=“validate service connection: validate CRI v1 runtime API for endpoint “unix:///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: Process exited with status 1
11:34:19 CST retry: [node1]

主要错误处:
[ERROR CRI]: container runtime is not running:
rpc error: code = Unimplemented desc = unknown service runtime.v1.RuntimeService

这说明 kubeadm 无法通过 CRI(容器运行时接口)与 containerd 通信,因为缺少了正确的服务实现,通常这是由于 containerd 的配置不兼容或者 containerd 安装得不完整。

首先确定containerd 配置正确启用了 CRI 插件,sudo cat /etc/containerd/config.toml | grep -A 5 “[plugins.“io.containerd.grpc.v1.cri”]”
在这里插入图片描述
查看不到没有

重新生成
sudo mv /etc/containerd/config.toml /etc/containerd/config.toml.bak
sudo containerd config default | sudo tee /etc/containerd/config.toml
在这里插入图片描述
重启
sudo systemctl restart containerd

查看验证
sudo ctr plugins ls | grep cri
在这里插入图片描述
在这里插入图片描述
再次初始化集群就可以了

http://www.xdnf.cn/news/5921.html

相关文章:

  • 5.13 note
  • Java反射详细介绍
  • AI 检测原创论文:技术迷思与教育本质的悖论思考
  • 组策略+注册表解决 系统还原 被禁问题
  • 推荐系统-基于特征掩码的自适应特征建模: AdaF^2M^2(DASFAA‘2025)
  • 【GNSS硬件接收机】【非公开文章】GNSS硬件接收机设计目录
  • JavaScript 模块封装函数
  • 函数加密(Functional Encryption)简介
  • 信奥赛-刷题笔记-队列篇-T2-P1540机器翻译和P2952Cow Line S
  • 抗菌肽Tet-213,1260528-09-3
  • Java并发编程-线程池(二)
  • 今日行情明日机会——20250513
  • 期货反向跟单软件—持仓上限控制功能
  • gcc和g++
  • 闭包原理与常见陷阱
  • 装饰器在Python中的作用及在PyTorchMMDetection中的实战应用
  • Python -将MP4文件转为GIF图片
  • MyBatis 批量新增与删除功能完整教程
  • SpringBoot的外部化配置
  • 软件测试(1) 软件测试概述
  • 【Qt开发】信号与槽
  • 【技术追踪】InverseSR:使用潜在扩散模型进行三维脑部 MRI 超分辨率重建(MICCAI-2023)
  • Ansible安装与核心模块实战指南
  • 如何正确地写出单例模式
  • 嵌入式软件--stm32 DAY7 I2C通讯上
  • 码蹄集——分解、数组最大公约数、孪生质数、卡罗尔数、阶乘数
  • PY32系列单片机离线烧录器,可配置选项字节和上机台批量烧录
  • The Deep Learning Compiler: A Comprehensive Survey (深度学习编译器:全面调查)
  • milvus+flask山寨《从零构建向量数据库》第7章case2
  • FPGA图像处理(六)------ 图像腐蚀and图像膨胀