Skip to content

Instantly share code, notes, and snippets.

@mprokopov
Created May 3, 2020 12:32
Show Gist options
  • Select an option

  • Save mprokopov/b76c8322908a17876856a8f30ef57c36 to your computer and use it in GitHub Desktop.

Select an option

Save mprokopov/b76c8322908a17876856a8f30ef57c36 to your computer and use it in GitHub Desktop.
Simple steps for k8s admin token creation
kubectl create serviceaccount k8sadmin -n kube-system
kubectl create clusterrolebinding k8sadmin --clusterrole=cluster-admin --serviceaccount=kube-system:k8sadmin
kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | (grep k8sadmin || echo "$_") | awk '{print $1}') | grep token: | awk '{print $2}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment