Skip to content

Instantly share code, notes, and snippets.

@rubencabrera
Created March 31, 2018 23:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rubencabrera/063652206f732aa7a6af9509231b72f1 to your computer and use it in GitHub Desktop.
Save rubencabrera/063652206f732aa7a6af9509231b72f1 to your computer and use it in GitHub Desktop.
Print kubernetes token (to access dashboard when using proxy)
# Your other aliases go here.
alias kubetoken="kubectl config view | grep -A10 \"name: \$(kubectl config current-context)\" | awk '\$1==\"access-token:\" {print \$2}'"
@rubencabrera
Copy link
Author

You can get the same string from the full output given by kubectl config view and looking for the value of the key access-token.

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