Is accessing kubernetes dashboard remotely possible?

+1 vote
Is accessing kubernetes dashboard remotely possible?
Nov 23, 2018 in Kubernetes by Ali
• 10,660 points

4 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
answered Nov 23, 2018 by Hannah
• 17,790 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
+1 vote

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

answered Apr 26, 2019 by Rick
0 votes

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 2, 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.

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 19, 2019 in Kubernetes by anonymous

closed Jun 20, 2019 by Kalgi 176 views
0 votes
2 answers

Accessing Kubernetes Web UI (Dashboard)

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

answered Apr 15, 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
• 50,980 points
+3 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 11, 2019 in Kubernetes by Kalgi
• 50,980 points

reshown Apr 12, 2019 by Kalgi 1,167 views
0 votes
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