问题
- 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
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
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
- 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.
- 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.
- 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