Products
...
Kubernetes Engine
How to generate access token to login
4 min
step 1 you can login to kubernetes using access token to generate access token you need create a service account for kubernetes dashboard service to create dashboard service account with the below mentioned yaml file using vi or nano editor \# kubernetes dashboard service account yaml apiversion v1 kind serviceaccount metadata name kubernetes dashboard admin user namespace kubernetes dashboard \ apiversion rbac authorization k8s io/v1 kind clusterrolebinding metadata name kubernetes dashboard admin user roleref apigroup rbac authorization k8s io kind clusterrole name cluster admin subjects \ kind serviceaccount name kubernetes dashboard admin user namespace kubernetes dashboard \ apiversion v1 kind secret type kubernetes io/service account token metadata name kubernetes dashboard token namespace kubernetes dashboard annotations kubernetes io/service account name kubernetes dashboard admin user step 2 generate the access token using the following command \# kubectl apply f kubernetes dashboard service account yaml following output is generated from the above command step 3 once the token is generated, use the following command to get the access token \# kubectl describe secret $(kubectl get secrets n kubernetes dashboard | grep kubernetes dashboard token | awk '{print $1}') n kubernetes dashboard step 4 from the above command, the output generated is given in screenshot below copy the generated token & paste it in the dashboard page in the token option as shown below & click on sign in button step 5 on clicking on the sign in option, you will get the kubernetes dashboard