Unable to install Kubernetes dashboard on AWS

10/16/2018

screenshotI'm trying to install kubernetes dashboard on AWS Linux image but I'm getting JSON output on the browser. I have run the dashboard commands and given token but it did not work.

-- Rakesh Sivagouni
amazon-linux
amazon-web-services
kubectl
kubernetes
kubernetes-dashboard

3 Answers

11/7/2018

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:

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.

For that use: kubectl get services --all-namespaces

kubectl edit service kubernetes-dashboard -n kube-system -o yaml and change the type to 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”.

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. There is a claim that you should use /ui after authentication, but it also does not work.

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

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

-- aurelius
Source: StackOverflow

10/16/2018

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/

More info

-- Arslanbekov
Source: StackOverflow

4/5/2019

Kubernetes 1.14+

1) Open terminal on your workstation: (standard ssh tunnel to port 8002)

$ 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

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/

-- Jan Rock
Source: StackOverflow