[root@node02 ~]# kubectl get pod
E0218 10:58:33.139354   37437 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp [::1]:8080: connect: connection refused
E0218 10:58:33.140227   37437 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp [::1]:8080: connect: connection refused
E0218 10:58:33.143318   37437 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp [::1]:8080: connect: connection refused
E0218 10:58:33.145017   37437 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp [::1]:8080: connect: connection refused
E0218 10:58:33.147309   37437 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp [::1]:8080: connect: connection refused
The connection to the server localhost:8080 was refused - did you specify the right host or port?

报错信息

无法获取当前服务器 API 组列表:获取“http://localhost:8080/api?timeout=32s”:拨号 tcp [::1]:8080:连接:连接被拒绝

二、解决办法

[root@node01 kubernetes]# mkdir ~/.kube
[root@node01 kubernetes]# cp /etc/kubernetes/kubelet.conf  ~/.kube/config

重新登陆,问题解决

[root@node02 ~]# kubectl get pod
NAME         READY   STATUS    RESTARTS   AGE
nginx-test   1/1     Running   0          31m

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐