简体   繁体   English

无法连接Minikube仪表板

[英]Unabled connect minikube dashboard

I configured my Ubuntu server (192.168.1.6) with minikube and kvm2, all seems ok 我用minikube和kvm2配置了我的Ubuntu服务器(192.168.1.6),一切似乎都还好

 $ minikube start --vm-driver=kvm2 Starting local
 Kubernetes v1.8.0 cluster... Starting VM... Getting VM IP address...
 Moving files into cluster... Setting up certs... Connecting to
 cluster... Setting up kubeconfig... Starting cluster components...
 Kubectl is now configured to use the cluster. Loading cached images
 from config file.


$ kubectl get po --all-namespaces
NAMESPACE     NAME                                    READY     STATUS    RESTARTS   AGE
default       node-hello-6dd6c8bb-j672z               1/1       Running   3          1d
kube-system   kube-addon-manager-minikube             1/1       Running   4          3d
kube-system   kube-dns-86f6f55dd5-27ttl               3/3       Running   12         3d
kube-system   kubernetes-dashboard-77c67f7cd9-wxsg9   1/1       Running   4          3d
kube-system   kubernetes-dashboard-n2fd4              1/1       Running   4          3d
kube-system   storage-provisioner

$ minikube dashboard --url
http://192.168.39.172:30000

But I cant't access on this IP from my home network on my computer (192.168.1.10). 但是我无法从计算机上的家庭网络(192.168.1.10)访问此IP。

When I put telnet 192.168.39.172 30000 I got error IP not reachable. 当我输入telnet 192.168.39.172 30000 ,出现错误IP无法访问。

EDIT : 编辑

I think I need to use SSH port forwarding 我想我需要使用SSH端口转发

kubectl proxy &
ssh -R 30000:127.0.0.1:8001 docker@192.168.39.172

but I can't open the port 30000 because it already listen in the Ubuntu server 但我无法打开端口30000,因为它已经在Ubuntu服务器中进行监听

tcp 0 0 :::30000 :::* LISTEN

How can I do that ? 我怎样才能做到这一点 ?

Thanks 谢谢

But I cant't access on this IP from my home network.

If I understand correctly, that you try to access minikube started on one computer from another one in your local network, then it will not work. 如果我正确理解,您尝试从本地网络中的另一台计算机访问在一台计算机上启动的minikube,则它将无法正常工作。 At least not until the client knows how to route traffic so that it can reach 192.168.39.172 which is a local bridge interface for your minikube VM. 至少直到客户端知道如何路由流量,它才能到达192.168.39.172,这是您的minikube VM的本地桥接口。

One of the solutions could be to set up additional routing rule to point 192.168.39.0/24 to the IP of your minikube host. 解决方案之一可能是设置其他路由规则,以将192.168.39.0/24指向minikube主机的IP。

Another would be to run kubectl proxy --address 0.0.0.0 on minikube host so that api is exposed on all interfaces (please mind that kubectl proxy adds authorization on it's own, meaning that if you open it like this, anything can access the API as you, without any auth) 另一种方法是在minikube主机上运行kubectl proxy --address 0.0.0.0 ,以便在所有接口上公开api(请注意,kubectl代理自己添加了授权,这意味着如果您像这样打开它,则任何东西都可以访问API和您一样,无需任何身份验证)

I was facing same issue, then I did curl on the dashboard url: 我遇到了同样的问题,然后我在仪表板网址上卷曲了:

curl <>:30000/ 卷曲<>:30000 /

% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 990 100 990 0 0 966k 0 --:--:-- --:--:-- --:--:-- 966k **You are using an outdated</strong> browser. %总接收百分比%Xferd平均速度时间时间时间时间当前Dload上传总剩余左速度100 990 100 990 0 0 966k 0-:-:--:-:--:-:- 966k **您正在使用过时的</ strong>浏览器。 Please upgrade your browser</a> to improve your experience.</p>** 请升级您的浏览器</a>以改善您的体验。</ p> **

I tried to open the same url from google chrome and was able to see the dashboard. 我试图从谷歌浏览器打开相同的URL,并且能够看到仪表板。

Sorry if the answer is not helpful, shared what I experienced. 抱歉,如果答案无济于事,请分享我的经验。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM