Difference between revisions of "Access Kubernetes REST API using default token"
Jump to navigation
Jump to search
Line 13: | Line 13: | ||
* <code>[[Content-Type: application/json]]</code> | * <code>[[Content-Type: application/json]]</code> | ||
* [[curl http://localhost:8080/api/]] | * [[curl http://localhost:8080/api/]] | ||
+ | * [[curl --header]] | ||
== See also == | == See also == |
Revision as of 18:40, 21 October 2023
APISERVER=$(kubectl config view --minify | grep server | cut -f 2- -d ":" | tr -d " ") TOKEN=$(kubectl describe secret default-token | grep -E '^token' | cut -f2 -d':' | tr -d " ") curl $APISERVER/api --header "Authorization: Bearer $TOKEN" --insecure Ref: https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/
{"type":"error","status":"401","message":"Unauthorized 401: must authenticate"}
Related
- Kubernetes bearer tokens
Content-Type: application/json
- curl http://localhost:8080/api/
- curl --header
See also
Advertising: