EKS nuggets: Unauthorized error via kubectl
EKS is the managed kubernetes service offering from AWS. After you have provisioned an EKS cluster you can access it via the kubectl utility. However, the kubectl utility requires you to have kubeconfig available in your home directory for it to be able to access the EKS cluster kubeApiServer.
At time while running kubectl commands you might get error as below:-
error: You must be logged in to the server (Unauthorized)
This would indicate that the user with which you are logged into the AWS CLI is not the one who has provisioned the cluster. AWS adds the user who has provisioned the cluster as a cluster admin in the EKS cluster RBAC.
To download EKS kubeconfig file you can run aws cli command as below:-
aws eks --region ap-south-1 update-kubeconfig --name <clustername>
Comments
Post a Comment