简体   繁体   English

错误执行阶段 kubelet-start: a Node with name … and status Ready已经存在于集群中

[英]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:解决方案可能是:

  1. Give Worker a new hostname by hostnamectl or some other tools.通过hostnamectl或其他一些工具给 Worker 一个新的主机名。
  2. Use the --node-name flag when joining the worker加入 worker 时使用--node-name标志

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.

相关问题 kubeadm加入失败,错误执行阶段kubelet-start:错误上传crisocket:超时等待条件 - kubeadm join failure, error execution phase kubelet-start: error uploading crisocket: timed out waiting for the condition kubelet.service:单元输入失败 state 未准备好 state 节点错误来自 kubernetes 集群 - kubelet.service: Unit entered failed state in not ready state node error from kubernetes cluster Kubernetes Kubelet错误更新节点状态 - Kubernetes kubelet error updating node status Kubernetes-无法使用云提供商openstack启动kubelet(从云提供商获取当前节点名称时出错) - Kubernetes - unable to start kubelet with cloud provider openstack (error fetching current node name from cloud provider) Kubelet 停止发布节点状态 - Kubelet stopped posting node status “Kubelet 停止发布节点状态”并且节点无法访问 - 'Kubelet stopped posting node status' and node inaccessible Kubelet停止发布节点状态(Kubernetes) - Kubelet stopped posting node status (Kubernetes) kube-apiserver是启动集群插件还是kubelet? - Does the kube-apiserver start up the cluster addons or does the kubelet? kubernetes集群主节点未准备好 - kubernetes cluster master node not ready 即使图像摘要已经存在于 Node 上,Kubelet 也会拉取图像 - Kubelet pulls image even though image digest is already present on Node
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM