Created
June 10, 2019 16:25
-
-
Save alexcmd/34c508c504525e0b60dc8f3d8a0e4a4c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create user token | |
kubectl create serviceaccount cluster-admin-dashboard-sa | |
# Bind ClusterAdmin role to the service account | |
kubectl create clusterrolebinding cluster-admin-dashboard-sa \ | |
--clusterrole=cluster-admin \ | |
--serviceaccount=default:cluster-admin-dashboard-sa | |
# Parse the token | |
TOKEN=$(kubectl describe secret $(kubectl -n kube-system get secret | awk '/^cluster-admin-dashboard-sa-token-/{print $1}') | awk '$1=="token:"{print $2}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment