2017-07-18 109 views
0

我下面的步骤中提到here配置,当我执行kubectl get nodes检查我的新创建集群的状态kubernete cluster.But,那个时候我收到错误消息The connection to the server localhost:8080 was refused - did you specify the right host or port? 在此链接它提到了Ubuntu 14.04 LTS 64位服务器,但我使用Ubuntu 16,04 64位。 你能帮我解决这个问题吗?无法设置Kubernete集群

回答

1

你需要运行下面的命令(作为一个经常性创建集群用户)初始化群集后:

sudo cp /etc/kubernetes/admin.conf $HOME/ 
sudo chown $(id -u):$(id -g) $HOME/admin.conf 
export KUBECONFIG=$HOME/admin.conf 

如果您仍然遇到它,请在GitHub上关注this issue

0

看起来您的客户端配置认为服务器在localhost:8080上运行,但可能并非如此。 你可以看看~/.kube/config文件,看看那里配置了什么? 也尝试运行kubectl --server=<SERVER_IP>:<SERVER_PORT> get nodes,看看这是否有帮助。