Other pc can't visit k8s dashboard

老子叫甜甜 提交于 2020-05-16 03:15:28

问题


  1. My mac can visit k8s dashboard, but other pc can't. What's the reason ?
    • @kubernetes/UI @kubernetes/dashboard
    • I have tried with the latest version of my channel (Stable or Edge)
    • macOS Version: 10.14
    • Docker for Mac: version: 19.03.1
    • k8s version : 1.14.3
    • eneble k8s on docker for mac setting
    • apply k8s dashboard.yaml
    • my mac ip is : 192.168.0.200
  2. kubectl get service --all-namaspaces

NAMESPACE NAME TYPE
CLUSTER-IP EXTERNAL-IP PORT(S) default ......... kubernetes ......... ClusterIP .........
10.96.0.1 ......... 443/TCP kube-system .......... kubernetes-dashboard .........
NodePort ......... 10.104.38.247 .........
443:31317/TCP

  1. kubectl cluster-info

Kubernetes master is running at https://kubernetes.docker.internal:6443 KubeDNS is running at https://kubernetes.docker.internal:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

  1. I can visit dashboard with below url on my pc.

kubernetes.docker.internal:31317 localhost:31317 127.0.0.1:31317 192.168.0.200:31317

And I have stopped firewall.

  1. One Lan, other pc can't visit 192.168.0.200:31317

And I don't know why. help me , thanks. Do you need other info?

Actually, I ask same question on github, and they suggest me to ask it on stackoverflow. And this is my first time ask question on stackoverflow, and if I do something wrong, please tell me.

  1. I excepted that other pc including windows and mac on the same LAN can visit my mac's k8s dashboard.

回答1:


You need to run kubectl proxy locally for accessing the dashboard outside the kubernetes cluster. You need to scp admin.conf file (file on your kubernetes master at /etc/kubernetes/admin.conf) to the machine from which you want to access the dashboard and pass it to kubectl command. Please, refer to following posts:

  • How to access/expose kubernetes-dashboard service outside of a cluster?
  • Kubernetes dashboard

To access the Dashboard navigate your browser to https://<server_IP>:31317



来源:https://stackoverflow.com/questions/58333637/other-pc-cant-visit-k8s-dashboard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!