Skip to content

Instantly share code, notes, and snippets.

@psucodervn
Created August 20, 2018 12:56
Show Gist options
  • Save psucodervn/0b37aae859ced65793ecbbeefd2fa4d7 to your computer and use it in GitHub Desktop.
Save psucodervn/0b37aae859ced65793ecbbeefd2fa4d7 to your computer and use it in GitHub Desktop.
Access kubenetes dashboard
# Create service account
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