Created
October 31, 2021 18:36
-
-
Save majorsilence/c87a60d737b1639b1d86d42e020701ef to your computer and use it in GitHub Desktop.
kubernetes get bearer token
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # kubectl get secrets | |
| # kubectl get endpoints | |
| # kubectl config view | |
| export token=$(kubectl describe secret default-token[THE RANDOM CODE] | grep ^token | cut -f7 -d ' ') | |
| curl https://[IP or host name]:6443/apis --header "Authorization: Bearer $token" -k |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment