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

k8s报错kubelet.go:2461] “Error getting node“ err=“node \“k8s-master\“ not found“

问题

首先最初问题:

[root@k8s-master ~]# kubectl get pods -owide --all-namespaces
The connection to the server 192.168.2.129:6443 was refused - did you specify the right host or port?

检查kubelet状态
查看kubelet status报找不到master节点

[root@k8s-master ~]# systemctl status  kubelet
● kubelet.service - kubelet: The Kubernetes Node AgentLoaded: loaded (/usr/lib/systemd/system/kubelet.service; enabled; vendor preset: disabled)Drop-In: /usr/lib/systemd/system/kubelet.service.d└─10-kubeadm.confActive: active (running) since 四 2025-04-17 10:22:59 CST; 5min agoDocs: https://kubernetes.io/docs/Main PID: 1213 (kubelet)Tasks: 17Memory: 170.7MCGroup: /system.slice/kubelet.service└─1213 /usr/bin/kubelet --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf --config=/var/lib/kubelet/config.yaml --network-plugin=cni --pod-infra-container-image=registr...

解决办法更新k8s集群证书

[root@k8s-master ~]# sudo kubeadm  certs renew all
[renew] Reading configuration from the cluster...
[renew] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'certificate embedded in the kubeconfig file for the admin to use and for kubeadm itself renewed
certificate for serving the Kubernetes API renewed
certificate the apiserver uses to access etcd renewed
certificate for the API server to connect to kubelet renewed
certificate embedded in the kubeconfig file for the controller manager to use renewed
certificate for liveness probes to healthcheck etcd renewed
certificate for etcd nodes to communicate with each other renewed
certificate for serving etcd renewed
certificate for the front proxy client renewed
certificate embedded in the kubeconfig file for the scheduler manager to use renewedDone renewing certificates. You must restart the kube-apiserver, kube-controller-manager, kube-scheduler and etcd, so that they can use the new certificates.

成功运行

[root@k8s-master ~]# kubectl get pods
NAME                                     READY   STATUS    RESTARTS      AGE
adservice-78b57fcf87-n252v               2/2     Running   0             13m
cartservice-55777c7ffd-sh2xd             2/2     Running   0             13m
checkoutservice-f5b7689d5-j6drp          2/2     Running   0             13m
currencyservice-5c454c8b5-t92l9          2/2     Running   0             13m
emailservice-67cf544dc-x4sxj             2/2     Running   1 (12m ago)   13m
frontend-c958f56fb-qtt2d                 2/2     Running   0             13m
loadgenerator-578d9f8456-ljqnn           2/2     Running   0             13m
paymentservice-688f5649f5-57dfh          2/2     Running   0             13m
productcatalogservice-7cd48ddfc7-mp8z6   2/2     Running   0             13m
recommendationservice-7dc9f5f575-8zqkm   2/2     Running   1 (12m ago)   13m
redis-cart-849bbcb78b-6c4dw              2/2     Running   0             13m
shippingservice-56d97db699-hghmq         2/2     Running   0             13m
http://www.dtcms.com/a/138279.html

相关文章:

  • 【秣厉科技】LabVIEW工具包——OpenCV 教程(20):拾遗 - imgproc 基础操作(下)
  • Python实例题:Python自动化开发-考勤处理
  • iptables防火墙
  • 深入浅出 Redis:核心数据结构解析与应用场景Redis 数据结构
  • 简述Apache RocketMQ
  • R语言简介与下载安装
  • 面试题之高频面试题
  • 扩展欧几里得算法【Exgcd】的内容与题目应用
  • MySQL-数据查询(CASE练习)-01
  • Vue 组件化开发
  • netty知识点
  • 51、Spring Boot 详细讲义(八) Spring Boot 与 NoSQL
  • C++栈与堆内存详解:Visual Studio实战指南
  • MyBatisPlus-QueryWrapper的exists方法拼接SQL中的EXISTS子句
  • Nginx | Apache 配置 WebSocket 多层代理基本知识(附疑难杂症)
  • 基于LightRAG进行本地RAG部署(包括单卡多卡本地模型部署、调用阿里云或DeepSeekAPI的部署方法、RAG使用方法)
  • 分布式存储数据恢复—hbase和hive数据库文件被删除如何恢复数据?
  • Layout 路由
  • Trea初体验:使用Trea从零到一创建一个项目,用来演示glog库的使用,一行代码没改完成了整个项目的搭建运行
  • 2843. 统计对称整数的数目
  • 【Pandas】pandas DataFrame xs
  • 全自动驾驶(FSD,Full Self-Driving)自动驾驶热点技术的成熟之处就是能判断道路修复修路,能自动利用类似“人眼”的摄像头进行驾驶!值得学习!
  • MYSQL “Too Many Connections“ 错误解决
  • 自动驾驶地图数据传输协议ADASIS v2
  • LCOV 使用文档
  • 制表符是什么?与.txt文件的关系?
  • 【JavaWeb】详细讲解 HTTP 协议
  • opencv函数展示2
  • 【力扣刷题】49字母异位词分组,不用哈希,c语言实现
  • 4.17---实现商铺和缓存与数据库双写一致以及宕机处理