Other pc can't visit k8s dashboard

10/11/2019
  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.
-- 高腾腾
docker
docker-for-mac
kubernetes
networking
settings

1 Answer

10/11/2019

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:

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

-- muscat
Source: StackOverflow