Is accessing kubernetes dashboard remotely possible?

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

4 answers to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
+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
• 14,080 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 by Vaidya
+1 vote

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

answered Apr 26 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 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?

Related Questions In Kubernetes

0 votes
2 answers

Accessing Kubernetes Web UI (Dashboard)

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

answered Apr 15 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
• 36,260 points
0 votes
1 answer

Is possible to have same k8s service for multiple pods?

Reserve a static IP and then assign ...READ MORE

answered Jul 20, 2018 in Kubernetes by Kalgi
• 36,260 points
0 votes
3 answers

Kubernetes dashboard status-CrashLoopBackOff

I had the same issue, struggled for days. ...READ MORE

answered Apr 24 in Kubernetes by Bebo
+3 votes
1 answer
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 in Others by anonymous
0 votes
1 answer
0 votes
1 answer

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.