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

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

问题描述

当我尝试测试kubectl的配置时

when i am trying to test the configuration of kubectl

kubectl get svc 

我正在得到这个 错误:服务器没有资源类型"svc"

i am getting this error: the server doesn't have a resource type "svc"

当我尝试此命令时

kubectl get services 

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

i am getting error: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

客户端版本:v1.10.3

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天全站免登陆