简体   繁体   English

无法在AWS上安装Kubernetes仪表板

[英]Unable to install Kubernetes dashboard on AWS

屏幕截图 I'm trying to install kubernetes dashboard on AWS Linux image but I'm getting JSON output on the browser. 我正在尝试在AWS Linux映像上安装kubernetes仪表板,但在浏览器上获取了JSON输出。 I have run the dashboard commands and given token but it did not work. 我已经运行了仪表板命令并给出了令牌,但是它没有用。

Kubernetes 1.14+ Kubernetes 1.14+

1) Open terminal on your workstation: (standard ssh tunnel to port 8002) 1)在工作站上打开终端:(到端口8002的标准ssh隧道)

$ ssh -i "aws.pem" -L 8002:localhost:8002 ec2-user@ec2-50-50-50-50.eu-west-1.compute.amazonaws.com $ ssh -i“ aws.pem” -L 8002:localhost:8002 ec2-user@ec2-50-50-50-50.eu-west-1.compute.amazonaws.com

2) When you are connected type: $ kubectl proxy -p 8002 2)连接时:$ kubectl proxy -p 8002

3) Open the following link with a web browser to access the dashboard endpoint: http://localhost:8002/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/ 3)使用Web浏览器打开以下链接以访问仪表板端点: http:// localhost:8002 / api / v1 / namespaces / kube-system / services / https:kubernetes-dashboard:/ proxy /

Try this: 尝试这个:

$ kubectl proxy

Open the following link with a web browser to access the dashboard endpoint: http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/ 使用Web浏览器打开以下链接以访问仪表板端点: http:// localhost:8001 / api / v1 / namespaces / kube-system / services / https:kubernetes-dashboard:/ proxy /

More info 更多信息

I had similar issue with reaching the dashboard following your linked tutorial. 在您链接的教程之后到达仪表板时,我遇到了类似的问题。 One way of approaching your issue is to change the type of the service to LoadBalancer: 解决问题的一种方法是将服务类型更改为LoadBalancer:

Exposes the service externally using a cloud provider's load balancer. 使用云提供商的负载平衡器从外部公开服务。 NodePort and ClusterIP services, to which the external load balancer will route, are automatically created. 将自动创建外部负载均衡器将路由到的NodePort和ClusterIP服务。

For that use: kubectl get services --all-namespaces 为此用途: kubectl get services --all-namespaces

kubectl edit service kubernetes-dashboard -n kube-system -o yaml and change the type to LoadBalancer. kubectl edit service kubernetes-dashboard -n kube-system -o yaml并将类型更改为LoadBalancer。 Wait till the the ELB gets spawned(takes couple of minutes) and then run kubectl get services --all-namespaces again and you will see the address of your dashboard service and you will be able to reach it under the “External Address”. 等待ELB产生(需要几分钟),然后再次运行kubectl get services --all-namespaces ,您将看到仪表板服务的地址,并且可以在“外部地址”下访问它。

As for the tutorial you have posted it is from 2016, and it turns out something went wrong with the /ui in the address url, you can read more about it in this github issue . 至于您发布的教程是2016年发布的,结果发现/ ui地址中的/ ui出了问题,您可以在github问题中阅读有关它的更多信息。 There is a claim that you should use /ui after authentication, but it also does not work. 有人声称您应在身份验证后使用/ ui,但它也不起作用。

For the default settings of ClusterIP you will be able to reach the dashboard on this address: 'YOURHOSTNAME'/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/login 对于ClusterIP的默认设置,您将能够访问该地址上的仪表板:'YOURHOSTNAME'/ api / v1 / namespaces / kube-system / services / https:kubernetes-dashboard:/ proxy /#!/ login

Another option is to delete the old dashboard: 另一个选择是删除旧的仪表板:

Kubectl delete -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml

Install the official one : 安装官方一个

kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml

Run kubectl proxy and reach it on localhost using: http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/overview 运行kubectl proxy并使用以下命令在localhost上访问它: http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/overview

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM