-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
EKS authentication slower with aws-cli than aws-iam-authenticator #5570
Comments
Hi @emaincourt, thanks for reporting. This sounds like an enhancement, not a bug. We would have to investigate what the implementation of Have you tested this in AWS CLI v1 to see if this is a change introduced in the AWS CLI v2? |
Just from the timing it looks like aws CLI is fetching a new token, while aws-iam-authenticator is just reusing my existing one. Adding 2.5 seconds on top of every kubectl call is unfeasible for my development needs. I would plead for treating this like a bug, as it is advertised as a drop in replacement for aws-iam-authenticator "you don't need to install the authenticator. Instead, you can use the aws eks get-token command" |
Looks like it tries to contact metadata server twice with a 1 second timeout despite AWS_PROFILE being set and
|
Setting the |
The metadata server stuff is interesting. The other major factor is just loading all of the Python code, I think. I time ~0.85s for Maybe another solution is to add a flag to |
I also have the exact same problem. We have just moved over to aws sso so we are forced to use aws eks get-token if we use aws sso to gain cli access to the eks cluster. So I would suggest this is actually a regression since i can no longer use aws-iam-authenticator. The speed difference is very annoying |
I ended up here after investigating why my pytest took so long to initialize. First I thought it was WSL on a corporate laptop, but it was as slow on my own 5950X. It turns out calls to that IP address mentioned in comments above add 8 to 10 seconds to my pytest initialization. I'm using boto3. boto3 does stuff with aws-cli. So I'm still not 100% sure, but at least adding AWS_EC2_METADATA_DISABLED=true gives some relieve. I do wonder what I am now missing out on...? |
I'm facing the same problem and I see that, for reasons beyond my comprehension,
apt-cache policy is indeed slow:
and so is any kubectl command:
|
Confirm by changing [ ] to [x] below to ensure that it's a bug:
Describe the bug
When using the
aws-cli
, it takes around 5 seconds to get a proper token to communicate with our EKS clusters. Performing the same action withaws-iam-authenticator
takes less than a second.SDK version number
aws-cli/2.0.50
aws-iam-authenticator/0.5.1
Platform/OS/Hardware/Device
Both MacOS and Ubuntu
To Reproduce (observed behavior)
Expected behavior
Both should respond in the same time.
Logs/output
Additional context
The text was updated successfully, but these errors were encountered: