quickstart-amazon-eks
quickstart-amazon-eks copied to clipboard
error: You must be logged in to the server (Unauthorized)
Generating a token is fine, but using the corresponding token authentication is not.
- When executing kubectl get nodes
kubectl get nodes
error: You must be logged in to the server (Unauthorized)
- When executing aws eks get-token --cluster-name ****
{"status": {"expirationTimestamp": "2020-11-11T02:09:04Z", "token": "k8s-aws-v1.*******uYXdzLmNvbS8_QWN0aW9uPUdldENhbGxlcklkZW50aXR5JlZlcnNpb249MjAxMS0wNi0xNSZYLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1FeHBpcmVzPTYwJlgtQW16LURhdGU9MjAyMDExMTFUMDE1NTA0WiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QlM0J4LWs4cy1hd3MtaWQmWC1BbXotU2VjdXJpdHktVG9rZW49Rndv********
- When executing curl -k -H 'Authorization: Bearer k8s-aws-v1.aHR0cHM** https://***eks.amazonaws.com.cn
{
"kind": "Status",
"apiVersion": "v1",
"metadata": {
},
"status": "Failure",
"message": "Unauthorized",
"reason": "Unauthorized",
"code": 401