Skip to content

Instantly share code, notes, and snippets.

@lixianyang
Created April 14, 2021 09:17
Show Gist options
  • Save lixianyang/f2b0a5c8f04030a858a2101953098e43 to your computer and use it in GitHub Desktop.
Save lixianyang/f2b0a5c8f04030a858a2101953098e43 to your computer and use it in GitHub Desktop.
create root token for kubernetes apiserver
admin_account="k8s-cyk-admin"
kubectl create serviceaccount ${admin_account} -n kube-system
kubectl create clusterrolebinding ${admin_account} --clusterrole=cluster-admin --serviceaccount=kube-system:${admin_account}
kubectl -n kube-system describe secrets $(kubectl -n kube-system get secret | grep ${admin_account} | awk '{print $1}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment