The connection to the server localhost:8080 was refused - did you specify the right host or port?
K8s系列之:The connection to the server localhost:8080 was refused - did you specify the right host or port?执行kubectl get pods报错如下所示:kubectl get pods -n kube-systemThe connection to the server localhost:8
·
K8s系列之:The connection to the server localhost:8080 was refused - did you specify the right host or port?
执行kubectl get pods报错如下所示:
kubectl get pods -n kube-system
The connection to the server localhost:8080 was refused - did you specify the right host or port?
解决方法:
vim /etc/profile
export KUBECONFIG=/etc/kubernetes/admin.conf
激活环境变量
source /etc/profile
再次执行kubectl get pods,成功执行如下所示
kubectl get pods -n kube-system
NAME READY STATUS RESTARTS AGE
coredns-6d8c4cb4d-grzcs 0/1 Pending 0 12m
coredns-6d8c4cb4d-mn6jr 0/1 Pending 0 12m
etcd-bigdata1 1/1 Running 7 13m
kube-apiserver-bigdata1 1/1 Running 103 13m
kube-controller-manager-bigdata1 1/1 Running 5 13m
kube-proxy-6b7p5 1/1 Running 0 12m
kube-scheduler-bigdata1 1/1 Running 5 13m
更多推荐
已为社区贡献4条内容
所有评论(0)