记一次node节点无法加入K8S集群
#问题现象:
root@small-virtual-machine:~# kubeadm join 10.0.0.133:6443 --token d2hyl5.5qt5fzjsdbxm2k5o --discovery-token-ca-cert-hash sha256:d02674df33be841548271e7f4333299a8bb39b2cf6c56b8bf90749d04b8ec0b1
[preflight] Running pre-flight checks
[preflight] Reading configuration from the cluster...
[preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'
W0914 09:12:14.393353 3271 utils.go:69] The recommended value for "resolvConf" in "KubeletConfiguration" is: /run/systemd/resolve/resolv.conf; the provided value is: /run/systemd/resolve/resolv.conf
error execution phase kubelet-start: a Node with name "small-virtual-machine" and status "Ready" already exists in the cluster. You must delete the existing Node or change the name of this new joining Node
To see the stack trace of this error execute with --v=5 or higher
root@small-virtual-machine:~# hostnamectl set-hostname node01
#解决:
原因是因为部署K8S集群的时候没有更改主机名导致。更改主机名以后重新kubeadm join即可
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?