无法安装 kubelet、Kubeadm 等

无法安装 kubelet、Kubeadm 等

简而言之,我弄乱了我的kubeadm集群并试图从头开始(我无法正确拆除集群,这就是为什么我被迫走这条路kubeadm resetsudo yum remove kubeadm kubectl kubelet kubernetes-cni kube*减去从集群中删除节点)。

我删除了所有软件包(在 RHEL 7 上运行)并且现在尝试重新安装,但在启动时出现错误:

-- Unit kubelet.service has begun starting up.
Nov 13 12:23:50 thalia2.ahc.umn.edu kubelet[31361]: F1113 12:23:50.681719   31361 server.go:190] failed to load Kubelet config file /var/lib/kubelet/config.yaml, error failed to
read kubelet config file "/var/lib/kubelet/config.yaml", error: open /var/lib/kubelet/config.yaml: no such file or directory
Nov 13 12:23:50 thalia2.ahc.umn.edu systemd[1]: kubelet.service: main process exited, code=exited, status=255/n/a
Nov 13 12:23:50 thalia2.ahc.umn.edu systemd[1]: Unit kubelet.service entered failed state.
Nov 13 12:23:50 thalia2.ahc.umn.edu systemd[1]: kubelet.service failed.
Nov 13 12:24:00 thalia2.ahc.umn.edu systemd[1]: kubelet.service holdoff time over, scheduling restart.
Nov 13 12:24:00 thalia2.ahc.umn.edu systemd[1]: Started kubelet: The Kubernetes Node Agent.
-- Subject: Unit kubelet.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit kubelet.service has finished starting up.
--

我看到的关于这个错误的每一篇文章都表明这个文件(/var/lib/kubelet/config.yaml)丢失了,因为我没有运行kubeadm init,但我没有创建主节点——我只是想像按照新安装一样运行它安装-kubeadm-kubelet-和-kubectl

我是不是忽略了某些显而易见的东西?几个月前,在kubeadm init开始首次安装之前,我不记得在每个节点上运行过,而且,在安装软件包的说明中也没有提到要执行kubelet serviceKubeadm init.

另请注意:在我以前的主节点上,尝试重新安装并启动后出现错误kubectl

Get https://134.84.53.162:6443/api/v1/pods?fieldSelector=spec.nodeName%3Dthalia0.ahc.umn.edu&limit=500&resourceVersion=0: dial tcp 134.84.53.162:6443: connect: connection refused
Nov 13 13:40:40 thalia0.ahc.umn.edu kubelet[17689]: W1113 13:40:40.487124   17689 cni.go:188] Unable to update cni config: No networks found in /etc/cni/net.d
Nov 13 13:40:40 thalia0.ahc.umn.edu kubelet[17689]: E1113 13:40:40.487404   17689 kubelet.go:2167] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNot
Ready message:docker: network plugin is not ready: cni config uninitialized

但是,我以为我已经通过执行kubeadm reset?删除了所有内容。

我确实删除了calico我以前的主节点(sudo rm -rf /var/etcd/calico-data)上的文件夹,然后重新启动了 kubectl,现在收到此错误:

Nov 13 13:55:37 thalia0.ahc.umn.edu kubelet[29725]: E1113 13:55:37.447381   29725 kubelet.go:2236] node "thalia0.ahc.umn.edu" not found
Nov 13 13:55:37 thalia0.ahc.umn.edu kubelet[29725]: E1113 13:55:37.547732   29725 kubelet.go:2236] node "thalia0.ahc.umn.edu" not found
Nov 13 13:55:37 thalia0.ahc.umn.edu kubelet[29725]: E1113 13:55:37.648002   29725 kubelet.go:2236] node "thalia0.ahc.umn.edu" not found
Nov 13 13:55:37 thalia0.ahc.umn.edu kubelet[29725]: E1113 13:55:37.748219   29725 kubelet.go:2236] node "thalia0.ahc.umn.edu" not found
Nov 13 13:55:37 thalia0.ahc.umn.edu kubelet[29725]: E1113 13:55:37.849201   29725 kubelet.go:2236] node "thalia0.ahc.umn.edu" not found
Nov 13 13:55:37 thalia0.ahc.umn.edu kubelet[29725]: E1113 13:55:37.950018   29725 kubelet.go:2236] node "thalia0.ahc.umn.edu" not found
Nov 13 13:55:38 thalia0.ahc.umn.edu kubelet[29725]: E1113 13:55:38.050193   29725 kubelet.go:2236] node "thalia0.ahc.umn.edu" not found
Nov 13 13:55:38 thalia0.ahc.umn.edu kubelet[29725]: E1113 13:55:38.150479   29725 kubelet.go:2236] node "thalia0.ahc.umn.edu" not found
Nov 13 13:55:38 thalia0.ahc.umn.edu kubelet[29725]: I1113 13:55:38.173736   29725 kubelet_node_status.go:276] Setting node annotation to enable volume controller attach/detach
Nov 13 13:55:38 thalia0.ahc.umn.edu kubelet[29725]: I1113 13:55:38.180154   29725 kubelet_node_status.go:70] Attempting to register node thalia0.ahc.umn.edu

因此,看起来我的旧集群中存在“残留”。是否存在 akubeadm reset和 asudo yum remove kubeadm kubectl kubelet kubernetes-cni kube*未删除的隐藏包?

答案1

问题最终是/var目录已满。清理后,一切正常。

答案2

我以为我已经通过执行kubeadm reset?删除了所有内容。

关于到文档它不会删除所有内容。它只是撤销更改,因此在您删除包并破坏所有路径的地方,运行kubeadm init以重新初始化集群。

相关内容