How do I create a service account for my dashboard and get all the credentails

0 votes
I have set up a cluster, Now i'm trying to figure out how to create an account on the dashboard and how do I get the token value and the credentials?

Thank you..
Oct 8, 2018 in Kubernetes by lina
• 8,200 points
421 views

1 answer to this question.

0 votes

Run the following commands:

This command will create a service account for a dashboard in the default namespace

kubectl create serviceaccount dashboard -n default

Add the cluster binding rules to your dashboard account

kubectl create clusterrolebinding dashboard-admin -n default \ --clusterrole=cluster-admin \ --serviceaccount=default:dashboard

Copy the secret token required for your dashboard login using the below command:

kubectl get secret $(kubectl get serviceaccount dashboard -o jsonpath="{.secrets[0].name}") -o jsonpath="{.data.token}" | base64 --decode

For detailed explaination, follow the instructions on this blog.

answered Oct 8, 2018 by Kalgi
• 51,810 points

Related Questions In Kubernetes

0 votes
1 answer
0 votes
1 answer

How do I update all my pods if the image is changed but the tag is the same?

Make sure your imagePullPolicy is set to ...READ MORE

answered Jul 12, 2019 in Kubernetes by Sirajul
• 48,770 points
98 views
0 votes
1 answer

How do I expose a service to a host outside the cluster?

There are two ways by which we ...READ MORE

answered Jul 12, 2019 in Kubernetes by Sirajul
• 48,770 points
65 views
0 votes
1 answer

How can i get all the pods on a node?

You can use the following command to ...READ MORE

answered Jul 12, 2019 in Kubernetes by Sirajul
• 48,770 points
56 views
+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 11, 2019 in Kubernetes by Kalgi
• 51,810 points

reshown Apr 12, 2019 by Kalgi 1,300 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
4,742 views
0 votes
1 answer