记一次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即可
 
posted @   安生丶  阅读(151)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
点击右上角即可分享
微信分享提示