-
Notifications
You must be signed in to change notification settings - Fork 979
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
Default Provider Service Account always created when overridden in ControllerConfig #2295
Comments
When setting a `ControllerConfig` `serviceAccountName`, for a provider, crossplane still creates its' own `ServiceAccount` which is not used by the provider pod. This changes that behaviour so that if a ControllerConfig overrides the `serviceAccountName` then a redundant SA will not be created. If an autogenerated SA is then overridden by `serviceAccountName` it will not be deleted until the `ProviderRevision` itself is cleaned up. Fixes crossplane#2295 Signed-off-by: Ben Agricola <[email protected]>
I was under the impression that setting this variable would set the name of the service account to be created? Would it be possible to have that behaviour and another flag createServiceAccount to decide if it should be created or not? I would prefer if crossplane can create the service account, clusterrole and clusterrolebindings, but I can decide on the name of the service account. The problem I'm having now is that I have a config for eksctl which has a block for IAM service accounts like so
And I would like to be able to use eksctl to create all those resources at once when creating new clusters, instead of having to first create some resources, then install the provider to get the random name and then go back and update the config and then go back to whatever else should go into the cluster. |
Hi, could we get any information from maintainers regarding this? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I'm still seeing the same behavior on 1.9.1 |
What happened?
Configuring
provider-aws
to use an existing IRSA-configured service account using the followingControllerConfig
:We end up with our existing
crossplane-aws-provider
as well as an automatically created service account, which then has theClusterRoleBinding
applied to allow it to manage resources.This means we have 1 service account with the right permissions to manage AWS resources and 1 with the right permissions to manage crossplane resources, but zero that can handle both:
How can we reproduce it?
Create a service account manually, use the above
ControllerConfig
to configure a provider and watch as you get 2 service accounts with mixed permissions.Suggested fix
Do not create the service account if name is overridden by
ControllerConfig
serviceAccountName
.Ideally use the existing service account name when requesting permissions from the RBAC manager. I'm not sure if this is possible as rbac manager uses the
owner
reference to work out what SA to apply the binding to. When the service account is not created by crossplane, it might be necessary to add an additional check to the binding provider (linked above) to make sure it doesn't try to create aClusterRoleBinding
with no subjects.What environment did it happen in?
Crossplane version: master on EKS
The text was updated successfully, but these errors were encountered: