After I delete arn:aws:eks:ap-northeast-1:000000000000:cluster/cluster1
context in .kube/config
, I can create the EKS cluster again.
localstack start
awslocal eks create-cluster \
--name cluster1 \
--role-arn "arn:aws:iam::000000000000:role/eks-role" \
--resources-vpc-config "{}"
But when I run the kubectl command:
kubectl get nodes
I got this error:
E0527 11:08:27.358638 30722 memcache.go:265] couldn't get current server API group list: the server has asked for the client to provide credentials
E0527 11:08:27.642766 30722 memcache.go:265] couldn't get current server API group list: the server has asked for the client to provide credentials
E0527 11:08:27.932002 30722 memcache.go:265] couldn't get current server API group list: the server has asked for the client to provide credentials
E0527 11:08:28.215254 30722 memcache.go:265] couldn't get current server API group list: the server has asked for the client to provide credentials
E0527 11:08:28.509132 30722 memcache.go:265] couldn't get current server API group list: the server has asked for the client to provide credentials
error: You must be logged in to the server (the server has asked for the client to provide credentials)
When I run the command with -v
kubectl get nodes -v
The details is
kubectl get nodes -v=10
I0527 11:07:01.291100 30213 loader.go:395] Config loaded from file: /Users/test/.kube/config
I0527 11:07:01.291405 30213 round_trippers.go:466] curl -v -XGET -H "User-Agent: kubectl/v1.30.1 (darwin/arm64) kubernetes/6911225" -H "Accept: application/json;g=apidiscovery.k8s.io;v=v2;as=APIGroupDiscoveryList,application/json;g=apidiscovery.k8s.io;v=v2beta1;as=APIGroupDiscoveryList,application/json" 'https://localhost.localstack.cloud:4510/api?timeout=32s'
I0527 11:07:01.589791 30213 round_trippers.go:495] HTTP Trace: DNS Lookup for localhost.localstack.cloud resolved to [{127.0.0.1 }]
I0527 11:07:01.590093 30213 round_trippers.go:510] HTTP Trace: Dial to tcp:127.0.0.1:4510 succeed
I0527 11:07:01.888528 30213 round_trippers.go:553] GET https://localhost.localstack.cloud:4510/api?timeout=32s 401 Unauthorized in 597 milliseconds
I0527 11:07:01.888560 30213 round_trippers.go:570] HTTP Statistics: DNSLookup 1 ms Dial 0 ms TLSHandshake 3 ms ServerProcessing 5 ms Duration 597 ms
I0527 11:07:01.888564 30213 round_trippers.go:577] Response Headers:
I0527 11:07:01.888569 30213 round_trippers.go:580] Cache-Control: no-cache, private
I0527 11:07:01.888574 30213 round_trippers.go:580] Content-Type: application/json
I0527 11:07:01.888576 30213 round_trippers.go:580] Date: Mon, 27 May 2024 02:07:00 GMT
I0527 11:07:01.888578 30213 round_trippers.go:580] Content-Length: 129
I0527 11:07:01.888580 30213 round_trippers.go:580] Audit-Id: d7d94a11-dab3-438c-87e3-a45ebff604a7
I0527 11:07:01.889035 30213 request.go:1212] Response Body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"Unauthorized","reason":"Unauthorized","code":401}
E0527 11:07:01.889291 30213 memcache.go:265] couldn't get current server API group list: the server has asked for the client to provide credentials
I0527 11:07:01.889304 30213 cached_discovery.go:120] skipped caching discovery info due to the server has asked for the client to provide credentials
I0527 11:07:01.889391 30213 round_trippers.go:466] curl -v -XGET -H "Accept: application/json;g=apidiscovery.k8s.io;v=v2;as=APIGroupDiscoveryList,application/json;g=apidiscovery.k8s.io;v=v2beta1;as=APIGroupDiscoveryList,application/json" -H "User-Agent: kubectl/v1.30.1 (darwin/arm64) kubernetes/6911225" 'https://localhost.localstack.cloud:4510/api?timeout=32s'
I0527 11:07:02.179045 30213 round_trippers.go:553] GET https://localhost.localstack.cloud:4510/api?timeout=32s 401 Unauthorized in 289 milliseconds
I0527 11:07:02.179075 30213 round_trippers.go:570] HTTP Statistics: GetConnection 0 ms ServerProcessing 3 ms Duration 289 ms
I0527 11:07:02.179079 30213 round_trippers.go:577] Response Headers:
I0527 11:07:02.179085 30213 round_trippers.go:580] Cache-Control: no-cache, private
I0527 11:07:02.179087 30213 round_trippers.go:580] Content-Type: application/json
I0527 11:07:02.179089 30213 round_trippers.go:580] Date: Mon, 27 May 2024 02:07:00 GMT
I0527 11:07:02.179091 30213 round_trippers.go:580] Content-Length: 129
I0527 11:07:02.179093 30213 round_trippers.go:580] Audit-Id: 4db51446-b5be-4109-977e-140d55557414
I0527 11:07:02.180338 30213 request.go:1212] Response Body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"Unauthorized","reason":"Unauthorized","code":401}
E0527 11:07:02.180593 30213 memcache.go:265] couldn't get current server API group list: the server has asked for the client to provide credentials
I0527 11:07:02.180604 30213 cached_discovery.go:120] skipped caching discovery info due to the server has asked for the client to provide credentials
I0527 11:07:02.180609 30213 shortcut.go:103] Error loading discovery information: the server has asked for the client to provide credentials
I0527 11:07:02.180675 30213 round_trippers.go:466] curl -v -XGET -H "Accept: application/json;g=apidiscovery.k8s.io;v=v2;as=APIGroupDiscoveryList,application/json;g=apidiscovery.k8s.io;v=v2beta1;as=APIGroupDiscoveryList,application/json" -H "User-Agent: kubectl/v1.30.1 (darwin/arm64) kubernetes/6911225" 'https://localhost.localstack.cloud:4510/api?timeout=32s'
I0527 11:07:02.470294 30213 round_trippers.go:553] GET https://localhost.localstack.cloud:4510/api?timeout=32s 401 Unauthorized in 289 milliseconds
I0527 11:07:02.470318 30213 round_trippers.go:570] HTTP Statistics: GetConnection 0 ms ServerProcessing 3 ms Duration 289 ms
I0527 11:07:02.470324 30213 round_trippers.go:577] Response Headers:
I0527 11:07:02.470328 30213 round_trippers.go:580] Audit-Id: 7733bff9-2e86-4a35-8b40-82adfa2c0531
I0527 11:07:02.470331 30213 round_trippers.go:580] Cache-Control: no-cache, private
I0527 11:07:02.470334 30213 round_trippers.go:580] Content-Type: application/json
I0527 11:07:02.470336 30213 round_trippers.go:580] Date: Mon, 27 May 2024 02:07:01 GMT
I0527 11:07:02.470340 30213 round_trippers.go:580] Content-Length: 129
I0527 11:07:02.470807 30213 request.go:1212] Response Body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"Unauthorized","reason":"Unauthorized","code":401}
E0527 11:07:02.471059 30213 memcache.go:265] couldn't get current server API group list: the server has asked for the client to provide credentials
I0527 11:07:02.471072 30213 cached_discovery.go:120] skipped caching discovery info due to the server has asked for the client to provide credentials
I0527 11:07:02.471153 30213 round_trippers.go:466] curl -v -XGET -H "Accept: application/json;g=apidiscovery.k8s.io;v=v2;as=APIGroupDiscoveryList,application/json;g=apidiscovery.k8s.io;v=v2beta1;as=APIGroupDiscoveryList,application/json" -H "User-Agent: kubectl/v1.30.1 (darwin/arm64) kubernetes/6911225" 'https://localhost.localstack.cloud:4510/api?timeout=32s'
I0527 11:07:02.756941 30213 round_trippers.go:553] GET https://localhost.localstack.cloud:4510/api?timeout=32s 401 Unauthorized in 285 milliseconds
I0527 11:07:02.756975 30213 round_trippers.go:570] HTTP Statistics: GetConnection 0 ms ServerProcessing 3 ms Duration 285 ms
I0527 11:07:02.756978 30213 round_trippers.go:577] Response Headers:
I0527 11:07:02.756984 30213 round_trippers.go:580] Content-Type: application/json
I0527 11:07:02.756986 30213 round_trippers.go:580] Date: Mon, 27 May 2024 02:07:01 GMT
I0527 11:07:02.756989 30213 round_trippers.go:580] Content-Length: 129
I0527 11:07:02.756991 30213 round_trippers.go:580] Audit-Id: a6462cbd-e99d-4214-9111-157462643de9
I0527 11:07:02.756994 30213 round_trippers.go:580] Cache-Control: no-cache, private
I0527 11:07:02.757417 30213 request.go:1212] Response Body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"Unauthorized","reason":"Unauthorized","code":401}
E0527 11:07:02.757670 30213 memcache.go:265] couldn't get current server API group list: the server has asked for the client to provide credentials
I0527 11:07:02.757680 30213 cached_discovery.go:120] skipped caching discovery info due to the server has asked for the client to provide credentials
I0527 11:07:02.757746 30213 round_trippers.go:466] curl -v -XGET -H "Accept: application/json;g=apidiscovery.k8s.io;v=v2;as=APIGroupDiscoveryList,application/json;g=apidiscovery.k8s.io;v=v2beta1;as=APIGroupDiscoveryList,application/json" -H "User-Agent: kubectl/v1.30.1 (darwin/arm64) kubernetes/6911225" 'https://localhost.localstack.cloud:4510/api?timeout=32s'
I0527 11:07:03.053843 30213 round_trippers.go:553] GET https://localhost.localstack.cloud:4510/api?timeout=32s 401 Unauthorized in 296 milliseconds
I0527 11:07:03.053871 30213 round_trippers.go:570] HTTP Statistics: GetConnection 0 ms ServerProcessing 3 ms Duration 296 ms
I0527 11:07:03.053875 30213 round_trippers.go:577] Response Headers:
I0527 11:07:03.053880 30213 round_trippers.go:580] Audit-Id: ec721429-86b8-47ad-acc0-79f39a3431cc
I0527 11:07:03.053897 30213 round_trippers.go:580] Cache-Control: no-cache, private
I0527 11:07:03.053903 30213 round_trippers.go:580] Content-Type: application/json
I0527 11:07:03.053905 30213 round_trippers.go:580] Date: Mon, 27 May 2024 02:07:01 GMT
I0527 11:07:03.053906 30213 round_trippers.go:580] Content-Length: 129
I0527 11:07:03.054261 30213 request.go:1212] Response Body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"Unauthorized","reason":"Unauthorized","code":401}
E0527 11:07:03.054550 30213 memcache.go:265] couldn't get current server API group list: the server has asked for the client to provide credentials
I0527 11:07:03.054565 30213 cached_discovery.go:120] skipped caching discovery info due to the server has asked for the client to provide credentials
I0527 11:07:03.054716 30213 helpers.go:246] server response object: [{
"metadata": {},
"status": "Failure",
"message": "the server has asked for the client to provide credentials",
"reason": "Unauthorized",
"details": {
"causes": [
{
"reason": "UnexpectedServerResponse",
"message": "unknown"
}
]
},
"code": 401
}]
error: You must be logged in to the server (the server has asked for the client to provide credentials)
Why the server asked for the client to provide credentials?
Doesn’t it provide by default? How to provide?