-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Need update iamserviceaccount
to be able to attach/detach Policies, without breaking running applications and cross-account Trust Relationships
#1497
Comments
I'm facing the exact same issue. My workaround is (probably) going to be generating the iam role via cloudformation out of band, and associating that with the service account so I can change the role over time. But agreed - would love if eksctl could support updates |
We need this feature as well. There is no way to amend a role without deleting the CF stack and the service account in k8s, then running |
@martina-if @dholbach Is this a relatively straightforward change? If so, would you be open to accepting a PR? We don't have a lot of Go expertise but not being able to update roles could be a blocker for us so I could take a stab at it if you're open to it. Or is there some other workaround to this that we're missing, short of manually updating roles after they were first created or managing them with another tool? |
Apologies this went unnoticed for too long. This looks like an important and useful feature.
The only addition I'd make to the proposed command is to allow updating other fields like |
@michaelbeaumont any update on how to get these service accounts to update? Even if not officially fixed is there a temp work around for this to keep us moving forward? |
@cdenneen We have used a few workarounds, most of them not ideal:
None of these are great, it seems this is some really basic functionality thats lacking... |
Yes, @rdubya16, indeed.
I want to understand exactly what happened, you added a new SA to |
@michaelbeaumont For the other 4 I think @rdubya16 suggestions might be the only option (#2 not so much) and (#3 getting very messy and unmanageable long term I would imagine... ) 1 is probably best bet since its sort of aligns with the other annotation update and actually with what should have happened if eksctl updated the stack properly. So yes my eksctl config already shows 4 attached policy arns so updating the 4 stacks seems logical (but without any sort of proper validation this can always be dangerous, i.e. if validation was working then the stack updates would be happening so now what will happen after I manually update them) |
Ultimately, this is due to the fact that create iamserviceaccount was not written to reconcile the config with the cluster, i.e. |
@michaelbeaumont you’d think however the SAs it created from scratch it should be able to properly update the policy’s on the role and then subsequently update the annotations to the updated role arn created. |
@michaelbeaumont Is there another issue to follow for this? We will soon be managing 50ish clusters with eksctl and its a huge pain to rollout iam permissions changes to all of them currently in a consistent manner. We can use CI to validate our eksctl values files but its currently impossible to verify if they are insync with cloudformation without checking manually. This feature is badly needed for us. |
this is currently being worked on #3064 feedback/thoughts are welcome 😄 |
|
Why do you want this feature?
I want to be able to attach/detach an IAM Policy to an IAM Service Account Role, without breaking running applications and cross-account Trust Relationships.
Currently the only way to change the attached Policies is to entirely delete the Role and then recreate the Role. This breaks all applications using that Service Account in the cluster until the applications are deleted and recreated in the presence the new Service Account.
It also permanently breaks cross-account trust relationships. Which can be a major hassle. First the new Role will have a new CF-generated name. And even if we could set a fixed Role name, it would still break all cross-account Trust Relationships:
https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html
The disruption is unnecessary, as Policy attachments to Roles are mutable in IAM and CloudFormation, but
eksctl
is missing the command to do it.The only workaround I see is to manually patch the CF stack outside of
eksctl
and update theeksctl
config file as if the role had been created that way.What feature/behavior/change do you want?
I propose a new command, e.g.
that updates the CF stack for the IAM Service Account, replacing the Policy attachments in the config file (or command).
The text was updated successfully, but these errors were encountered: