Skip to content

Instantly share code, notes, and snippets.

@AliKhadivi
Last active August 27, 2022 09:20
Show Gist options
  • Save AliKhadivi/d7067f886985dc5f4820387edeffb7bd to your computer and use it in GitHub Desktop.
Save AliKhadivi/d7067f886985dc5f4820387edeffb7bd to your computer and use it in GitHub Desktop.
Kubernetes dashboard deploy

Kubernetes dashboard deploy

Install dashboard:

kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/aio/deploy/recommended.yaml

Create Token:

kubectl -n kube-system create serviceaccount TOKEN-NAME
kubectl create clusterrolebinding TOKEN-NAME --clusterrole=cluster-admin --serviceaccount=kube-system:TOKEN-NAME

Replace TOKEN-NAME with your custom token name;

Get Token:

kubectl -n kube-system get secret $(kubectl -n kube-system get serviceaccount/TOKEN-NAME -o jsonpath='{.secrets[0].name}') -o jsonpath='{.data.token}'| base64 --decode

Replace TOKEN-NAME with your custom token name;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment