-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Unable to Obtain IAM Service Credentials from OpenID/EKS #3090
Comments
Hey @ijaveed can you please share the code that you are using to reproduce this? |
I have been working with @ijaveed on this issue. Here is the code we have. Within our Helm chart we have defined the following service.
We have reference to this in the deployment.
I am aware of the issue of running this as non-root and the work around using the fsGroup, however for the sake of experimentation I have tried this as running as root and non-root. I can see in the pod that the AWS_ROLE_ARN and AWS_WEB_IDENTITY_TOKEN_FILE have both been correctly set. I have also added the AWS_REGION environment variable to see if that made any difference.
For the purposes of trying to get this to work, we have a simplified version of our queue consuming logic. It's essentially the code snippets taken from AWS documentation.
We have also tried supplying dummy access keys as advised elsewhere with no luck.
|
@ijaveed @johnwatson484 I have been having this issue myself when using the S3 client. e.g |
@aRobinson-R7 thanks, we had tried that with no luck. We raised a support ticket with AWS who supplied a code sample that should work. It was pretty similar to what I'd tried above. However, without making any changes it starting magically working so I'm not sure if they also made changes to the Either way it confirmed this is not an SDK issue. |
Closing this issue now, please reach out for additional questions. |
I am having the same issue with node and IAM roles - I've confirmed the serviceAccount and IAM role permissions are correct by testing in an amaxonlinux container with aws-cli. |
Sure, this was the response we got back. Open an interactive session with the pod in question and enter the following commands. --node -> It will take us to a terminal with ">"
It should return something along the lines of the below and you should see the response object at the bottom returning the IAM account details.
If it returns an assumed identity then the issue is in the application code's use of the SDK. If it doesn't then something is incorrect somewhere in the OIDC, IAM, trust policy area. It's also important to remember the workaround using For this to work you must have this set. Below is a trimmed down version of our Helm chart we use for deployment with the value hard coded in for an example. If you're not using Helm then the equivalent Kubernetes pod yaml will be similar.
|
Many thx @johnwatson484 much appreciated. Gives me something to try during lockdown! :) |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
Describe the bug
We are using EKS & are now moving away from using worker node instance profiles to provide credentials to using IAM service roles for pods.
I have followed all the instructions in relation to IAM service roles for Pods -->
https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts-technical-overview.html
We have tested this with the latest version with awscli which is able to obtain the credentials via oidc provider..
But when we use the aws-sdk-js, it does not even attempt to connect to the oidc provider , but rather still wants to try & connect to the instance metadata service at 169.254.... ( as per the docs , the worker node has an iptables rules which blocks access to it from all eni's)
the correct variables are present & the uid within the container is able to read the credentials file...
The text was updated successfully, but these errors were encountered: