Skip to content

EKS connectivity issue on windows local cli

0

I have created eks and continuously trying to connect from windows cli, but always throwing error. I am able to check aws resources from cli also able to see cluster and nodegroup with command like eksctl get iamidentitymapping --cluster myeks_cluster1

but getting issue with kubectl E0928 20:24:40.071813 7228 memcache.go:265] "Unhandled Error" err="couldn't get current server API group list: the server has asked for the client to provide credentials"

C:\Windows\System32>eksctl get iamidentitymapping --cluster myeks_cluster1 Error: getting auth ConfigMap: Unauthorized

C:\Windows\System32>kubectl version Client Version: v1.31.0-eks-a737599 Kustomize Version: v5.4.2 error: You must be logged in to the server (the server has asked for the client to provide credentials)

C:\Windows\System32>kubectl get pods -v=10

"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)

pls help!

1 Answer
0

Hello,

You can check eks authentication mode from this link: https://docs.aws.amazon.com/eks/latest/userguide/setting-up-access-entries.html, for examples: 'API_AND_CONFIG_MAP','CONFIG_MAP','API'.

If 'API_AND_CONFIG_MAP' or 'API' , you can create new access, add iam access to the cluster: https://docs.aws.amazon.com/eks/latest/userguide/creating-access-entries.html.

if 'CONFIG_MAP', you must update auth-configmap, before that you should find out the user/role who created this eks cluster, and set aws cli credentials :https://docs.aws.amazon.com/eks/latest/userguide/auth-configmap.html

AWS
SUPPORT ENGINEER
answered 2 years ago
  • Hi @whb, It doe not solve the problem. I got the problem solved I found in EKS cluster, there is a section tab "Access" and there a user need to be added who can right permission. this issue arise because cluster is directly created on aws console and then trying to connect from cli.

    But anyways, thanks for reply.

  • Hello Nick,

    If you solved by add user in "Access" section tab, the EKS cluster auth mode is 'API_AND_CONFIG_MAP' or 'API'. The user who created on aws console is admin of the cluster by default, if you want to connect from cli, you should use this user's aksk for cli or add cli user/role in "Access" section tab.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.