【k8s】The connection to the server localhost:8080 was refused - did you specify the right host or port

在主机上配置了kubeconfig,但同事反馈kubectl get报错The connection to the server localhost:8080 was refused - did you specify the right host or port。

这个错误提示表示kubectl命令无法连接到Kubernetes API Server。
原因:
在paasuser用户的家目录下配置的kubeconfig,同事使用root用户登录,无法使用kubectl。将kubeconfig复制一份到root的家目录即可。

posted @ 2024-12-30 10:49  五号操场  阅读(453)  评论(0)    收藏  举报