k8s报错Error getting node“ err=“node \“k8smaster\“ not found

在初始化K8S时候,遇到以下错误

复制代码
Unfortunately, an error has occurred:
		timed out waiting for the condition

	This error is likely caused by:
		- The kubelet is not running
		- The kubelet is unhealthy due to a misconfiguration of the node in some way (required cgroups disabled)

	If you are on a systemd-powered system, you can try to troubleshoot the error with the following commands:
		- 'systemctl status kubelet'
		- 'journalctl -xeu kubelet'

	Additionally, a control plane component may have crashed or exited when started by the container runtime.
	To troubleshoot, list all containers using your preferred container runtimes CLI.

	Here is one example how you may list all Kubernetes containers running in docker:
		- 'docker ps -a | grep kube | grep -v pause'
		Once you have found the failing container, you can inspect its logs with:
		- 'docker logs CONTAINERID'

error execution phase wait-control-plane: couldn't initialize a Kubernetes cluster
To see the stack trace of this error execute with --v=5 or higher

E0815 14:16:57.735202   68860 kubelet.go:2461] "Error getting node" err="node \"k8smaster\" not found"

服务虽然启动着,但是节点没有被发现

排查过主机名配置的没问题,hosts文件配置也没问题

最后发现是,初始化的 --apiserver-advertise-address 集群master地址 配置的和主机的IP不一致才导致初始化异常报错

将集群master地址与主机IP地址改为一致的地址

然后重置kubeadm并重新加载kubelet服务

当前master节点重置kubeadm
kubeadm reset -f

重新加载kubelet服务
systemctl daemon-reload && systemctl restart kubelet

相关推荐
.柒宇.1 小时前
AI掘金头条项目-K8s部署实战教程
python·云原生·容器·kubernetes·fastapi
AI攻城狮2 小时前
DeepSeek V4:LLM 世界的"好又多"超市
云原生
AI精钢2 小时前
AI Agent 从上线到删库跑路始末
网络·人工智能·云原生·aigc
AI攻城狮3 小时前
RAG 的 Chunking 有什么好方案?从原理到实战选型
云原生
AI攻城狮6 小时前
如何提高 RAG 的检索质量?这才是真正的瓶颈所在
云原生
AI攻城狮9 小时前
DeepSeek KV Cache 入门解读:98% 命中率背后的工程逻辑
云原生
weixin_3776348412 小时前
【MinerU】 Docker Compose 使用
docker·容器·mineru
菜鸟的日志12 小时前
【软件架构风格】面向服务架构(SOA)及其微服务演进
微服务·云原生·架构
PH = 713 小时前
K8S集群的搭建
云原生·容器·kubernetes
CS创新实验室13 小时前
CS实验室行业报告:云计算与云原生行业分析报告
云原生·云计算