k8s报错:The connection to the server localhost:8080 was refused
现象k8s节点使用kubectl get pods --all-namespaces报错[root@node1 ~]# kubectl get pods --all-namespacesThe connection to the server localhost:8080 was refused - did you specify the right host or port?原因该节点未对kub
·
现象
k8s节点使用kubectl get pods --all-namespaces报错
[root@node1 ~]# kubectl get pods --all-namespaces
The connection to the server localhost:8080 was refused - did you specify the right host or port?
原因
该节点未对kubernetes进行配置
解决办法
拷贝master节点的/etc/kubernetes/admin.conf配置文件到/etc/kubernetes/目录下,并执行如下命令
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
更多推荐
已为社区贡献36条内容
所有评论(0)