其他PC无法访问K8S仪表板 [英] Other pc can't visit k8s dashboard
问题描述
- 我的Mac可以访问k8s仪表板,但其他PC无法访问.什么原因 ?
- @ kubernetes/UI @ kubernetes/仪表板
- 我尝试使用最新版本的频道(稳定版或边缘版)
- macOS版本:10.14
- 适用于Mac的Docker:版本:19.03.1
- k8s版本:1.14.3
- 在docker上启用k8s进行mac设置
- 应用k8s仪表板.yaml
- 我的mac ip是:192.168.0.200
- 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
名称空间名称类型
CLUSTER-IP EXTERNAL-IP PORT(S)默认......... kubernetes ......... ClusterIP .........
10.96.0.1 ......... 443/TCP kube-system .......... kubernetes-dashboard .........
NodePort ......... 10.104.38.247 .........
443:31317/TCP
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主服务器运行在 https://kubernetes.docker.internal:6443 KubeDNS运行于 https://kubernetes. docker.internal:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
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
- 我可以在PC上使用以下网址访问仪表板.
kubernetes.docker.internal:31317本地主机:31317 127.0.0.1:31317 192.168.0.200:31317
kubernetes.docker.internal:31317 localhost:31317 127.0.0.1:31317 192.168.0.200:31317
我已经停止了防火墙.
- 一个局域网,其他电脑无法访问192.168.0.200:31317
我不知道为什么. 帮帮我,谢谢. 您还需要其他信息吗?
And I don't know why. help me , thanks. Do you need other info?
实际上,我在github上问了同样的问题,他们建议我在stackoverflow上问这个问题. 这是我第一次问关于stackoverflow的问题,如果我做错了什么,请告诉我.
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.
- 我除外,同一局域网上的其他计算机(包括Windows和Mac)都可以访问我的Mac的k8s仪表板.
推荐答案
您需要在本地运行kubectl代理才能访问kubernetes集群之外的仪表板.您需要将admin.conf文件(在/etc/kubernetes/admin.conf
上的kubernetes主目录上的文件)scp到要从其访问仪表板的机器上,并将其传递给kubectl命令.请参考以下帖子:
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
要访问仪表板,请在浏览器中导航到https://<server_IP>:31317
To access the Dashboard navigate your browser to https://<server_IP>:31317
这篇关于其他PC无法访问K8S仪表板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!