[英]Unable to access the EC2 Kubernetes dashboard
I followed How can I access to kube.netes dashboard using NodePort in a remote cluster for testing?我按照如何在远程集群中使用 NodePort 访问 kube.netes 仪表板进行测试?
My Kube.netes cluster runs in Amazon EC2 instances and cluster services looks like below我的 Kube.netes 集群在 Amazon EC2 实例中运行,集群服务如下所示
$ kubectl get services --all-namespaces
NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
default kubernetes ClusterIP 100.64.0.1 <none> 443/TCP 5h54m
kube-system kube-dns ClusterIP 100.64.0.10 <none> 53/UDP,53/TCP 5h53m
kube-system kubernetes-dashboard NodePort 100.68.178.51 <none> 443:31872/TCP 5h47m
$ kubectl cluster-info
Kubernetes master is running at https://api.selumalai.k8s.com
KubeDNS is running at https://api.selumalai.k8s.com/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
I have exposed the NodePort at 31872. If I access the dashboard in browser using我已经在 31872 处公开了 NodePort。如果我使用浏览器访问仪表板
$ kubectl proxy -p 8001 &
$ curl https://api.selumalai.k8s.com:31872
Its loading forever.它永远加载。 What am I doing wrong?我究竟做错了什么?
You need to add a security group
to your instance to allow traffic for port 31872
.您需要向您的实例添加一个security group
以允许端口31872
的流量。
It's explained how to do so here . 在这里解释了如何这样做。
If you use kubectl proxy
it can be accessed localy only, which is stated in the docs :如果你使用kubectl proxy
,它只能在本地访问,这在文档中有说明:
... ...
kubectl proxy
... The UI can only be accessed from the machine where the command is executed. ...只能从执行命令的机器访问用户界面。 See
kubectl proxy --help
for more options.有关更多选项,请参阅kubectl proxy --help
。
Also here is a guide from AWS on how to Deploy the Kube.netes Dashboard (web UI) .这里还有一份来自 AWS 的指南,介绍如何部署 Kube.netes 仪表板(Web UI) 。 You can try running a L7 ELB to expose the Dashboard which is explained here .您可以尝试运行 L7 ELB 来公开此处解释的仪表板。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.