Kubectl get节点返回“服务器不具有资源类型" nodes". [英] Kubectl get nodes return "the server doesn't have a resource type "nodes""
问题描述
我安装了Kubernetes,执行了kubeadm init,并从工作人员那里加入了.但是当我运行kubectl get节点时,它会给出以下响应
I installed the Kubernetes and performed kubeadm init and join from the worker too. But when i run kubectl get nodes it gives the following response
服务器没有资源类型节点"
the server doesn't have a resource type "nodes"
这里可能是什么问题?在/var/log/messages
What might be the problem here? COuld not see anything in the /var/log/messages
这里有任何提示吗?
推荐答案
在我看来,身份验证凭据设置不正确.您是否将kubeconfig文件/etc/kubernetes/admin.conf
复制到~/.kube/config
?如果您使用kubeadm,则应将API服务器配置为在6443而不是8080上运行.您还可以检查KUBECONFIG变量是否未设置吗?
It looks to me that the authentication credentials were not set correctly. Did you copy the kubeconfig file /etc/kubernetes/admin.conf
to ~/.kube/config
? If you used kubeadm the API server should be configured to run on 6443, not in 8080. Could you also check that the KUBECONFIG variable is not set?
使用标志--v=99
还可以提高详细级别.此外,您是从安装了Kubernetes主组件的同一台机器上进行访问,还是从外部进行访问?
It would also help to increase the verbose level using the flag --v=99
. Moreover, are you accessing from the same machine where the Kubernetes master components are installed, or are you accessing from the outside?
这篇关于Kubectl get节点返回“服务器不具有资源类型" nodes".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!