K8s ❉ The connection to the server 报错localhost:8080 was refused & 开源 | GPU池化软件 V2.8.2 (AI人工智能训练平台、AI
【代码】K8s ❉ The connection to the server 报错localhost:8080 was refused。开源 | GPU池化软件 V2.8.2 (AI人工智能训练平台、AI人工智能推理平台)
·
现象描述
K8s集群初始化成功后,kubectl get nodes 查看节点信息时报错:
报错信息:
The connection to the server localhost:8080 was refused - did you specify the right host or port?
解决办法:
执行以下命令
[root@slave1 ~]# kubectl get pod,svc
The connection to the server localhost:8080 was refused - did you specify the right host or port?
[root@slave1 ~]# mkdir -p $HOME/.kube
[root@slave1 ~]# cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
[root@slave1 ~]# echo "export KUBECONFIG=/etc/kubernetes/admin.conf" >> ~/.bash_profile
[root@slave1 ~]# source ~/.bash_profile
[root@slave1 ~]# chown $(id -u):$(id -g) $HOME/.kube/config
[root@slave1 ~]# kubectl get pod
NAME READY STATUS RESTARTS AGE
nginx-6867cdf567-966sx 1/1 Running 0 15m
更多推荐
已为社区贡献1条内容
所有评论(0)