I am getting error when I run any kubectl
command.
$ kubectl version
Client Version: v1.29.1
error: You must be logged in to the server (the server has asked for the client to provide credentials)
I have run below command to configure the EKS cluster.
I am using aws cli version aws-cli/2.17.51
.
$ aws eks --region <region> update-kubeconfig --name <my-cluster-name>
Command did run successfully and I can see configuration is updated in kubectl config file.
I have a AWS root user who has created the EKS Cluster and I am using a IAM user to access this cluster. The IAM user is having all the required permissions and roles to access this cluster.
Also, the cluster has the IAM access entries
configured for this IAM user as AmazonEKSAdminPolicy
.
I have used aws configure
to configure the IAM user’s keys in the aws command line.
But still I am getting this error.
I did follow multiple solutions to fix this error but of no use.
Kubectl asking: error: You must be logged in to the server (the server has asked for the client to provide credentials)