Kubernetes仪表板 [英] Kubernetes dashboard
问题描述
我已经能够在Centos 7服务器上成功设置kubernetes. 在遵循文档之后,尝试使仪表板工作a>,运行"kubectl代理" 尝试使用127.0.0.1:9001而不是我的服务器IP运行.这是否意味着我无法访问服务器外部的kubernetes仪表板? 我需要有关使用公用ip来运行仪表板的帮助
I have been able to successfully setup kubernetes on my Centos 7 server. On trying to get the dashboard working after following the documentation, running 'kubectl proxy' it attempts to run using 127.0.0.1:9001 and not my server ip. Do this mean I cannot access kubernetes dashboard outside the server? I need help on getting the dashboard running using my public ip
推荐答案
您可以指定要在哪个地址上运行kubectl proxy
,即
You can specify on which address you want to run kubectl proxy
, i.e.
kubectl proxy --address <EXTERNAL-IP> -p 9001
Starting to serve on 100.105.***.***:9001
您还可以使用端口转发来访问仪表板.
You can also use port forwarding to access the dashboard.
kubectl port-forward --address 0.0.0.0 pod/dashboard 8888:80
这将侦听所有地址上的端口8888,并将流量直接路由到您的Pod.
This will listen port 8888 on all addresses and route traffic directly to your pod.
例如:
rsha:~$ kubectl port-forward --address 0.0.0.0 deploy/webserver 8888:80
Forwarding from 0.0.0.0:8888 -> 80
在另一个正在运行的终端
In another terminal running
rsha:~$ curl 100.105.***.***:8888
<html><body><h1>It works!</h1></body></html>
这篇关于Kubernetes仪表板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!