Kubectl get nodes command fails with E1020

0

I create my VPC and EKS cluster using terraform, after this after that I executed the command "aws eks --region <my-region> update-kubeconfig --name <my-cluster-name>" to get access to the cluster API on my local machine, but for some reason when I make a request to kubectl get nodes I get the error "E1020 couldn't get current server API group list: the server has asked for the client to provide credentials"

2 Answers
0

In the end, the guide on restoring access to the cluster helped me eks-api-recover-cluster-access, but I want to understand why I initially had no access to it after its creation.

answered 3 months ago
0

Hello, Glad to hear you were able to restore access. The initial problem may have been created by a variety of issues, such as:

  • IAM Role Mismatch When you create an EKS cluster using Terraform, the IAM role used to create the cluster is automatically granted full access to it. However, if you're using a different IAM user or role to access the cluster afterwards, you may encounter permission issues

  • aws-auth ConfigMap The aws-auth ConfigMap is crucial for mapping IAM roles to Kubernetes RBAC permissions. If this ConfigMap is not properly configured, you may be unable to access the cluster

  • Kubeconfig File An outdated or incorrectly configured kubeconfig file can lead to authentication issues. The kubeconfig file needs to be updated with the correct cluster information and credentials

  • Authentication Mode EKS clusters can be configured with different authentication modes. If your cluster is set to use API server authentication only, you may need to update it to use both API and ConfigMap authentication

Which one was the cause in your case it is difficult to say without knowing more, maybe the way you were able to restore access can provide some hints on the specific cause. Best,

AWS
answered 3 months ago

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.

Guidelines for Answering Questions