-
Notifications
You must be signed in to change notification settings - Fork 40
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
aws-auth: controller may remove role when it is not intended #299
Comments
Sort of related to this - I ran into a situation where the AWS CDK overwrote the I checked controller logs and I only see what seem to be startup logs which would make make sense why a reboot worked; it retriggered the aws auth sync:
would it be possible to reconcile the |
Yeah, the key here is triggering a reconcile. |
That'd be great. If we wanted to give people opt-in we could do it conditionally on an annotation on |
Yeah, I was thinking more of a controller flag e.g. If you wanted to work on it I can help guide you to the areas in the code where this can be added, otherwise not sure when we'll have the capacity to implement this |
Sure I'd be happy to take a look; where would I get started? |
Main place would be here:
If you look at that configMapReconciler, it gets called by configmap watch here:
Currently that reconciler is used to reconcile changes to the instance-manager configmap - there is an early if to only proceed if the configmap being reconciled is the instance-manager one:
We can add an else if to that statement and check if this is the instance-manager/controllers/reconcilers.go Lines 106 to 120 in ae893c4
In the above it compares the MD5 hash of the configmap data, to the last known hash (persisted in status.ConfigHash), we can probably skip all of that and simply reconcile all IGs for any aws-auth change. There is some common code between those two if's that can probably be refactored a bit. For adding the flag you need to pass it through from main to InstanceGroupReconciler: Lines 80 to 92 in ae893c4
Lines 152 to 168 in ae893c4
This will make it available to the configMapReconciler Feel free to ping me if you need any help. |
Great, I'll poke in and hopefully get this sorted, thanks! |
A common pitfall people are facing when trying out instance-manager is that they create an IG using a role that is already bootstrapped in the cluster. When the IG is deleted the role is removed causing all nodes using that role to go to NotReady state.
We should evaluate ways to avoid this such as:
--no-remove-auth
etcCurrent behavior is to avoid removing roles when other IGs use them, but the case which is not covered is if a regular nodegroup is sharing a role with an IG
The text was updated successfully, but these errors were encountered: