ianbelcher/eks-kubectl-action

Unauthorized error

Closed this issue · 6 comments

I am always getting the follwing error when trying to update the image in my deployment although I have proper IAM roles set up:
error: You must be logged in to the server (Unauthorized)

Any ideas on how to solve this issue?

zmays commented

same here

Run ianbelcher/eks-kubectl-action@master
...
Attempting to update kubeconfig for aws
Added new context ***/testing-cluster to /github/home/.kube/config
error: You must be logged in to the server (the server has asked for the client to provide credentials)
zmays commented

I think my cluster is setup to use aws-iam-authenticator, which this action does not install

@zmays did you figure this out ?

@AashiqDurga You just have to authorize the user in your cluster: https://docs.aws.amazon.com/eks/latest/userguide/add-user-role.html

Sorry, I totally missed this entire issue.

You need to not only grant AWS based permissions to your IAM user through the normal AWS policies, you also need to make Kubernetes aware of that user as @PorterK has mentioned.

The link in the previous comment is a great resource and the link in the README for this repo also supplies a great walk through for setting up such a user.