cby-chen / Kubernetes

kubernetes (k8s) 二进制高可用安装,Binary installation of kubernetes (k8s) --- 开源不易,帮忙点个star,谢谢了🌹
https://www.oiox.cn
GNU General Public License v3.0
885 stars 309 forks source link

kubectl get nodes 返回No resources found #22

Open a1004201125 opened 1 year ago

a1004201125 commented 1 year ago

使用命令 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.

mrzhu147 commented 1 year ago

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

MiracleTanC commented 1 year ago

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

LiuMicheal commented 1 month ago

我按照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 commented 1 month ago

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