与服务器 localhost:8080 的连接被拒绝 - 您是否指定了正确的主机或端口? [英] The connection to the server localhost:8080 was refused - did you specify the right host or port?

查看:28
本文介绍了与服务器 localhost:8080 的连接被拒绝 - 您是否指定了正确的主机或端口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试测试 kubectl 的配置时

when i am trying to test the configuration of kubectl

kubectl get svc 

我收到了

错误:服务器没有资源类型svc"

error: the server doesn't have a resource type "svc"

当我尝试这个命令时

kubectl get services 

我收到错误:

与服务器 localhost:8080 的连接被拒绝 - 您是否指定了正确的主机或端口?

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

我正在按照本用户指南在我的 mac 上部署 kubernetes 应用程序

and i am following this userguide to deploy a kubernetes application on my mac

https://docs.aws.amazon.com/eks/latest/userguide/getting-started.html#eks-create-cluster

Admins-MacBook-Pro:~ Harshin$ kubectl version --short --client
Client Version: v1.10.3

推荐答案

复制配置文件并解决此问题:

Make a copy of the config file and resolve this issue:

sudo mkdir ~/.kube
sudo cp /etc/kubernetes/admin.conf ~/.kube/

cd ~/.kube

sudo mv admin.conf config
sudo service kubelet restart

这篇关于与服务器 localhost:8080 的连接被拒绝 - 您是否指定了正确的主机或端口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆