Is accessing kubernetes dashboard remotely possible

+3 votes
Is accessing kubernetes dashboard remotely possible?
Nov 23, 2018 in Kubernetes by Ali
• 11,360 points

5 answers to this question.

+1 vote

To access to Kubernetes Dashboard via proxy from remote machine, you will need to grant ClusterRole to allow access to dashboard.

Create new file and insert following details.

vi dashboard-access.yaml
kind: ClusterRoleBinding
  name: kube-dashboard
    k8s-app: kube-dashboard
  kind: ClusterRole
  name: cluster-admin
- kind: ServiceAccount
  name: kube-dashboard
  namespace: kube-system

Now apply changes to Kubernetes Cluster to grant access to dashboard.

kubectl create -f dashboard-access.yaml

For further details, refer to the Kubernetes Training.

answered Nov 23, 2018 by Hannah
• 18,570 points
+1 vote
As far as I know, I don't think it's possible to access the dashboard remotely. You can only access your dashboard from the master node.
answered Apr 26, 2019 by Vaidya
Yes it is possible by using NodePort instead of ClusterIP

[root@test ~]#   kubectl  edit service kubernetes-dashboard -n kubernetes-dashboard

[root@test ~]# kubectl get services -n kubernetes-dashboard
NAME                        TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)         AGE
dashboard-metrics-scraper   ClusterIP   <none>        8000/TCP        18h
kubernetes-dashboard        NodePort   <none>        443:31824/TCP   18h [Login Link]
+1 vote

Kubernetes API server is exposed and accessible from outside you can directly access dashboard at: 

answered Apr 26, 2019 by Rick
+1 vote

It seems only the api request from localhost to the dashboard service can be accepted in proxy mode. Then the quest becomes how to make a request from a remote host look like from localhost of where the proxy is running (k8s master node, in my case).

Here are the steps:

1,  deploy dashboard serive on master node:

kubectl apply -f

2, start proxy: 
kubectl proxy&

3, create your own secret and obtain the token:
kubectl create serviceaccount <account name>
kubectl create clusterrolebinding dashboard-admin --clusterrole=cluster-admin --serviceaccount=default:<account name>
kubectl get secret
kubectl describe secret <secret name>

4, create ssh tunnel from a remote host outside of the cluster where you would access dashboard:
ssh -L 9999: -N -f -l <user name> <k8s master host name or ip>
"-L" local port forwarding
"9999" is a local host port. it can be any available port. It can also be 8001
"" is where the proxy runs on k8s master host
Password may be required for the <user name> on the master host to create a tunnel
This command forwards any local request on port 9999 to"" on the master host

5, open a browser with the following api:

Then select "token" and past the token to log in the dashboard.

This approach does not require any addtional configuration in k8s cluster. It is recommended by Oracle:
Good luck.
answered May 3, 2019 by Ling
Hey @Ling, Thanks for such a nice explanation. I shall try it out. But could you please explain the third step? I do not understand why do we need to create a secret token?
Thanks a lot. This comment helped me solve the issue.

Thanks a lot!!
This works like a charm, with a few caveats (easily fixed)


kubectl describe secret <secret name>


kubectl get svc --all-namespaces

To get the namespace the dashboard is running in.

The command that worked for me to open the tunnel is a simplified version of the original, run from a CMD window (the latest versions of Win10 now come with SSH).

ssh -L 9999: -N <username>@<kubernetes-dashboard-host>

The link to access the dashboard needs to be adjusted:


I'm working through "Hands-On Microservices with Kubernetes: Build, deploy, and manage scalable microservices on Kubernetes" by Gigi Sayfan

Reading the ebook in Windows 10, running Kubernetes in headless Ubuntu 18.04.
This instructions allowed me to access the dashboard from my browser in Win10.

+1 vote
Yes it is possible by using NodePort instead of ClusterIP

[root@test ~]#   kubectl  edit service kubernetes-dashboard -n kubernetes-dashboard

[root@test ~]# kubectl get services -n kubernetes-dashboard
NAME                        TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)         AGE
dashboard-metrics-scraper   ClusterIP   <none>        8000/TCP        18h
kubernetes-dashboard        NodePort   <none>        443:31824/TCP   18h [Login Link]
answered Mar 9, 2020 by Ali
• 160 points

Related Questions In Kubernetes

0 votes
0 answers

Kubernetes dashboard Url is not accessing in my browser?

im facing the issue from yesterday.  i ...READ MORE

Jun 20, 2019 in Kubernetes by anonymous

closed Jun 20, 2019 by Kalgi 968 views
+1 vote
2 answers

Accessing Kubernetes Web UI (Dashboard)

To access Kubernetes dashboard, you need to ...READ MORE

answered Apr 16, 2019 in Kubernetes by Ray
+1 vote
1 answer

Is autoscaling possible in kubernetes ingress nginx

In principle, the NGINX ingress controller is ...READ MORE

answered Oct 24, 2018 in Kubernetes by Kalgi
• 52,360 points
+4 votes
1 answer

Installing Web UI (Dashboard):kubernetes-dashboard on main Ubuntu 16.04.6 LTS (Xenial Xerus) server

Follow these steps: $ kubeadm reset $ kubeadm init ...READ MORE

answered Apr 12, 2019 in Kubernetes by Kalgi
• 52,360 points

reshown Apr 12, 2019 by Kalgi 6,446 views
+1 vote
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17, 2019 in Others by anonymous
0 votes
1 answer
0 votes
1 answer
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP