-
Notifications
You must be signed in to change notification settings - Fork 404
Integration with AWS IAM Roles for ServiceAccounts #200
Conversation
- Update AWS SDK version - securityContext in a helm chart
@arruzk Sorry for the late response, but I downloaded the latest helm version with 2.1.0 docker image, turned fsgroup to 65534 and annotation configured the service account annotation to the IAM role i want. Have you tested if it is really working with the IRSA ? Thanks so much |
@imaffe just checked now. Everything is working for me. env:
AWS_REGION: eu-west-1
# created in terraform
serviceAccount:
name: secrets-manager
create: false
image:
tag: latest
pullPolicy: Always
securityContext:
fsGroup: 65534 From pod env: - name: AWS_ROLE_ARN
value: arn:aws:iam::11111111111:role/staging-ir-1-sm-reader-role
- name: AWS_WEB_IDENTITY_TOKEN_FILE
value: /var/run/secrets/eks.amazonaws.com/serviceaccount/token Try to log in into the pod (with exec) and do |
@arruzk when testing this did you verify the role which is being assumed does not have the node in its trusted relationships? Is it possible the container was actually using the node's role + kiam in your tests? |
I've fixed it, and I checked the trust relationship in the EKS cluster page, my problem was the serviceaccount name defined doesn't align with the trusted IAM role arn in the trusted relationships. The service account name is not the same as the app name, I think it's their helm chart didn't follow the conventions. |
Service account name can be overriden by providing |
If there's specific steps to get it all working it would be great if someone wants to do a PR to update the docs :) |
Thanks @imaffe, turns out my namespace wasn't aligned in the trusted relationships of the IAM role. Thanks for the help guys! |
Anybody tried it with EKS? the pod is always trying to use the node_group role although I have all configured right and this file |
@mo-saeed yes we are using it with EKS, take a look at my previous comments in this issue. |
It is a second attempt to do it (first is #176). With recent changes it is easier.
It should fix this issue #161
Sorry @farshad-hobsons if you are working on it now.
@Flydiverny @silasbw could you please review it?