Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eksctl get iamidentitymapping does not obey assume role in kube config #916

Closed
nikolai-derzhak-distillery opened this issue Jun 20, 2019 · 11 comments

Comments

@nikolai-derzhak-distillery
Copy link

nikolai-derzhak-distillery commented Jun 20, 2019

I noticed that eksctl get iamidentitymapping does not work with assume-role in kube config (generated by aws --region $AWS_REGION eks update-kubeconfig --name $CLUSTER_NAME --role-arn $AWS_ROLE ) :

$ eksctl get iamidentitymapping --name=$CLUSTER_NAME
[✖]  getting auth ConfigMap: Unauthorized

while eksctl get nodegroup --cluster $CLUSTER_NAMEworks fine.

Also I can just edit aws-auth yaml like this:

kubectl edit -n kube-system configmap/aws-auth

Guess related to this feature request : #749

eksctl version
[ℹ] version.Info{BuiltAt:"", GitCommit:"", GitTag:"0.1.37"}

@cPu1
Copy link
Contributor

cPu1 commented Jul 3, 2019

@nikolai-derzhak-distillery aws eks update-kubeconfig --role-arn adds the role flag (--role) to the aws-iam-authenticator client (or to aws eks get-token if using the latest AWS CLI) in the exec config. However, supplying a role ARN for aws-iam-authenticator to use is not supported in eksctl for any of the commands.
So in both of your commands, credentials from your default AWS profile (or ENV vars) are being used.

The reason eksctl get iamidentitymapping is failing might be because the role ARN for your credentials is not present in the aws-auth ConfigMap, which maps AWS IAM roles/users to Kubernetes groups.
eksctl get nodegroup, OTOH, works because it doesn't use the Kubernetes API but rather the AWS API for accessing the CloudFormation stacks.

@mykhailoponomarov
Copy link

Hi, I'm observing the same behavior, we assume admin role from our AWS profiles so eksctl throws Unauthorized error. Would appreciate support of roles assumption!

@danbeaulieu
Copy link

Also see this issue using eksctl 0.31.0.

We have 2 roles: 1 that can describe-cluster and other "AWS" level APIs. Another role that is used for in cluster operations, such as modifying a configmap. This second role is added to the aws-auth config map to allow these operations.

for instance in the same shell aws eks describe-cluster --name foo and kubectl edit -n kube-system configmap/aws-auth work.

using eks create iamidentitymapping does not appear to use the configured KUBECONFIG file but instead use the current IAM role for both AWS level APIs AND cluster level operations and in our case this means the cluster level operations fail and the configmap can not be updated.

@github-actions
Copy link
Contributor

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the stale label Jan 25, 2021
@michaelbeaumont
Copy link
Contributor

Related #2745 #1356 (comment)

@github-actions
Copy link
Contributor

This issue was closed because it has been stalled for 5 days with no activity.

@zafai
Copy link

zafai commented Feb 3, 2021

We face the same problem that @danbeaulieu describes
Are there any plans to implement this?

@RamazanKara
Copy link

We also face the same problem.

@RamazanKara
Copy link

For those who still face this issue: check if your Users / roles have additional ARN Paths in the role / User ARN. EG: accountxyARN:/testpath/role. We had to remove these paths in the AWSAUTH configmap to get it working

@github-actions
Copy link
Contributor

github-actions bot commented Apr 2, 2021

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the stale label Apr 2, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Apr 8, 2021

This issue was closed because it has been stalled for 5 days with no activity.

@github-actions github-actions bot closed this as completed Apr 8, 2021
torredil pushed a commit to torredil/eksctl that referenced this issue May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants