how to access local kubernetes minikube dashboard remotely

前端 未结 9 485
离开以前
离开以前 2021-01-30 14:46

Kubernetes newbie (or rather basic networking) question: Installed single node minikube (0.23 release) on a ubuntu box running in my lan (on IP address 192.168

9条回答
  •  攒了一身酷
    2021-01-30 15:18

    Jeff Prouty added useful answer:

    I was able to get running with something as simple as:

    kubectl proxy --address='0.0.0.0' --disable-filter=true

    But for me it didn't worked initially.

    I run this command on the CentOS 7 machine with running kubectl (local IP: 192.168.0.20).

    When I tried to access dashboard from another computer (which was in LAN obviously):

    http://192.168.0.20:8001/api/v1/namespaces/kube-system/services/kubernetes-dashboard/proxy/
    

    then only timeout was in my web browser.

    The solution for my case is that in CentOS 7 (and probably other distros) you need to open port 8001 in your OS firewall.

    So in my case I need to run in CentOS 7 terminal:

     sudo firewall-cmd --zone=public --add-port=8001/tcp --permanent
     sudo firewall-cmd --reload
    

    And after that. It works! :)

    Of course you need to be aware that this is not safe solution, because anybody have access to your dashbord now. But I think that for local lab testing it will be sufficient.

    In other linux distros, command for opening ports in firewall can be different. Please use google for that.

提交回复
热议问题