Skip to content
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

RefreshSecurityGroups should only be called on ENIs already checked by the ENI/IP reconciler #2875

Closed
joshjp-aws opened this issue Apr 16, 2024 · 8 comments

Comments

@joshjp-aws
Copy link

What would you like to be added:
I would like the current behavior to change. Currently the ENI/IP reconciler runs on a 60 second loop while the SG reconciler runs on a 30 second loop. Further both reconcilers pull information on the ENIs from IMDS.

Consider a scenario where an instance is launched and shortly after an ENI with the node.k8s.amazonaws.com/no_manage: true tag is added to the instance. If the SG reconciler runs before the ENI/IP reconciler it will modify the security groups as the ENI/IP reconciler hasn't had a chance to check the tags on the ENI yet.

Ideally the SG reconciler would only run against ENIs which are known and confirmed to not have this label attached.

One option here is to have the SG reconciler rely on an internal cache while the ENI/IP reconciler is responsible for pulling the ENIs from IMDS and determine if it is managed/unmanaged.

Why is this needed:
To prevent the SG reconciler from updating ENIs with the node.k8s.amazonaws.com/no_manage: true tag

@orsenthil
Copy link
Member

One option here is to have the SG reconciler rely on an internal cache while the ENI/IP reconciler is responsible for pulling the ENIs from IMDS and determine if it is managed/unmanaged.

This is a good idea. We will evaluate this.

@sorjii
Copy link

sorjii commented Apr 25, 2024

Thanks for looking at this @orsenthil. Will be on standby for the fix as this is affecting production workload in our environment.

@jayanthvn
Copy link
Contributor

Basically we don't need this -

allENIs, err := cache.GetAttachedENIs()
rather pull from datastore unmanaged ENI cache.. might it be tricky to do it and would need some refactoring..

@orsenthil orsenthil mentioned this issue Apr 25, 2024
2 tasks
@orsenthil
Copy link
Member

This is addressed.

Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.

@sorjii
Copy link

sorjii commented May 16, 2024

@orsenthil is there a new release version for this fix? thanks

@orsenthil
Copy link
Member

@sorjii - Not yet. We are planning to release 1.18.2 with this change and other security fixes which are in pipeline. The change is merged in master.

@sorjii
Copy link

sorjii commented May 16, 2024

Thanks for the quick response, really appreciate it. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants