Kubernetes: get service account secret for dashboard login

To login to the Kubernetes dashboard, you need a token. This token can be retrieved with the following command:

kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep <admin-user> | awk '{print $1}')

Published by


I'm a student at TUM in Computer Science & Pizza eating. Passionate for SRE, beautiful Code and Club Mate.