k8s The connection to the server was refused - did you specify the right host or port?
k8s The connection to the server 172.29.247.208:6443 was refused - did you specify the right host or port?
·
记录服务器重启之后,k8s 报的错
k8s The connection to the server 172.29.247.208:6443 was refused - did you specify the right host or port?
通过将主节点的Kubernetes配置文件复制到用户的.kube目录,并将权限更改为当前用户,然后将KUBECONFIG环境变量设置为该配置文件的路径来解决"connection to the server … was refused"问题。这将使用户可以访问Kubernetes集群并运行kubectl命令。
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
export KUBECONFIG=/etc/kubernetes/admin.conf
结语
关注我技术公众号。
更多推荐
已为社区贡献1条内容
所有评论(0)