Kubernetes icon indicating copy to clipboard operation
Kubernetes copied to clipboard

kubectl get nodes 返回No resources found

Open a1004201125 opened this issue 2 years ago • 4 comments

使用命令 kubectl get cs 和 kubectl gt csr 返回正常,而到了 kubectl get nodes 的时候,返回 No resources found. 检查kubelet的状态,提示: "Unable to register node with API server" err="nodes is forbidden: User "system:anonymous" cannot create resource "nodes" in API group "" at the cluster scope" node="master2" kube-controller-manager提示: No authentication-kubeconfig provided in order to lookup client-ca-file in configmap/extension-apiserver-authentication in kube-system, so client certificate authentication won't work.

a1004201125 avatar Dec 11 '22 16:12 a1004201125

证书文件看上去没有下发成功,检查下master2的ansible变量配置试试

mrzhu147 avatar Feb 27 '23 03:02 mrzhu147

v1.27.1,走到8.2.5查看集群了,kubectl get nodes 返回No resources found 我的是单master的,也是这种状况,求解决方案

MiracleTanC avatar Jun 26 '23 01:06 MiracleTanC

我按照v1.28.3走的,走到kubectl get nodes也返回No resources found,通过三个步骤解决: 1)之前忘记关闭master和node的swap了,关闭之后,kubelet.service才正常。 2)master上也要装kubelet。装后,kubectl get node可以看到master。 3)node上不能装Nginx!把node上的Nginx.service关闭之后,问题解决,kubectl get node可以看到master和node。

LiuMicheal avatar Jul 30 '24 01:07 LiuMicheal

上面的3)回答错了,node上也要安装Nginx。如果node上不装Nginx,master上用kubectl get node将会得到NotReady。

LiuMicheal avatar Jul 30 '24 08:07 LiuMicheal