[英]Error execution phase kubelet-start: a Node with name … and status Ready already exists in the cluster
I'm playing around with Kubernetes on Virtualbox.我在 Virtualbox 上玩 Kubernetes。 I have created 2 VMs, one is the Master - the other one is the Worker.
我创建了 2 个虚拟机,一个是 Master,另一个是 Worker。 The Worker is a clone of the basis installation of the master.
Worker 是 master 基础安装的克隆。 I guess that's the root-cause of the problem, maybe there's some config left over which causes conflicts.
我想这是问题的根本原因,也许还有一些配置会导致冲突。
When I try to join the Worker with...当我尝试加入 Worker 时...
sudo kubeadm join 192.168.56.101:6443 --token ... --discovery-token-ca-cert-hash ...
I get the following error...我收到以下错误...
error execution phase kubelet-start: a Node with name "test-virtualbox" and status "Ready" already exists in the cluster.
错误执行阶段 kubelet-start:集群中已经存在一个名为“test-virtualbox”且状态为“Ready”的节点。 You must delete the existing Node or change the name of this new joining Node
您必须删除现有节点或更改此新加入节点的名称
I have tried to reset the config with...我试图用...重置配置
sudo kubeadm reset
But after running the join command I get the same error again.但是在运行 join 命令后,我再次遇到相同的错误。
I also tried to delete the node "test-virtualbox" by running...我还尝试通过运行删除节点“test-virtualbox”...
sudo kubectl delete node test-virtualbox
But this results in the error...但这会导致错误...
The connection to the server localhost:8080 was refused
与服务器 localhost:8080 的连接被拒绝
There are several problems or questions you mentioned您提到的有几个问题或疑问
a Node with name "test-virtualbox" and status "Ready" already exists in the cluster.
集群中已存在名称为“test-virtualbox”且状态为“Ready”的节点。
kubeadm
uses the hostname as the node name by default, as you Clone the worker from the master, they should have the same hostname as the error said. kubeadm
使用主机名作为节点名,当您从主服务器克隆工作人员时,它们应该具有与错误所述相同的主机名。
the solution for this could be:解决方案可能是:
hostnamectl
or some other tools.hostnamectl
或其他一些工具给 Worker 一个新的主机名。sudo kubeadm reset
须藤 kubeadm 重置
reset
is used to reset a node inside the cluster, your worker has not yet joined, it does nothing when you did this. reset
用于重置集群内的节点,您的工作人员尚未加入,当您这样做时它什么也不做。
sudo kubectl delete node test-virtualbox
sudo kubectl 删除节点 test-virtualbox
This is executed on the Worker, right?这是在 Worker 上执行的,对吧?
The Worker has not yet joined the cluster, so you do not have a kubeconfig
in ~/.kube/config
, kubectl will use localhost:8080
as server address by default, it can not connect to the target API Server, so that error occurred. Worker 还没有加入集群,所以
~/.kube/config
中没有kubeconfig
,kubectl 会默认使用localhost:8080
作为服务器地址,无法连接到目标 API 服务器,所以出现错误.
just running "sudo kubectl delete node test-virtualbox" on the master只是在主服务器上运行“sudo kubectl delete node test-virtualbox”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.