Authorization / Authentication#
Review the API server logs to get more details about the authentication error. This may provide additional clues as to why the request is failing.
Make sure you can reach the Kubernetes API server from your machine:
1
|
curl -k https://<api-server-address>:<port>/healthz
|
1
|
curl -k https://<api-server-address>:<port>/api/v1/namespaces --header "Authorization: Bearer <token>"
|
1
|
kubectl auth can-i --list
|
1
2
3
4
5
|
chmod 600 /path/to/admin.crt /path/to/admin.key /path/to/ca.crt
kubectl config view -o jsonpath='{.users}'
curl --cert /path/to/admin.crt --key /path/to/admin.key --cacert /path/to/ca.crt https://<api-server-address>:<port>/api/v1/namespaces
|