Skip to content

Centralized leaked ENI cleanup- refactor periodic cleanup & add node termination cleaner #505

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

Merged
merged 10 commits into from
Mar 24, 2025

Conversation

sushrk
Copy link
Contributor

@sushrk sushrk commented Dec 24, 2024

Description of changes:

PR 2, adding support for Centralize leaked ENI cleanup in the controller to delete leaked ENIs provisioned by the controller and VPC-CNI:

  • Refactor periodic cleanup routine and add support for node termination cleaner. The node termination is invoked upon a node deletion from the CNINode controller as part of the finalizer routine. The finalizer was added in PR 1 on CNINode objects.
  • Added metrics for leaked ENIs
  • Add support for DisassociateTrunkInterface, call DisassociateTrunkInterface to remove association between branch and trunk ENI before deleting the branch ENI as per recommendation by EC2 team.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@sushrk sushrk marked this pull request as ready for review December 26, 2024 22:02
@sushrk sushrk requested a review from a team as a code owner December 26, 2024 22:02
@sushrk sushrk requested a review from yash97 January 2, 2025 08:46
@sushrk sushrk marked this pull request as draft February 27, 2025 00:33
@yash97 yash97 marked this pull request as ready for review March 4, 2025 20:47
@yash97 yash97 requested a review from haouc March 5, 2025 18:17
@yash97 yash97 requested a review from haouc March 21, 2025 22:03
Copy link
Contributor

@haouc haouc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a couple of comments but they don't block this PR. Thanks.

@yash97 yash97 merged commit e6b6cda into aws:eni-cleanup Mar 24, 2025
4 checks passed
yash97 added a commit to yash97/amazon-vpc-resource-controller-k8s that referenced this pull request Mar 26, 2025
…termination cleaner (aws#505)

* Centralized leaked ENI cleanup- refactor periodic cleanup & add node termination cleaner

* defer updating metrics

* WIP commit no.3

* instance id as tag, not requeuing on node cleanup failure

* not requeing on node termination cleaner failure

* minor log change

* adding node termination failure metric

* minor test change

* using paginated calls to describe network interface while eni cleanup

* refactor based on comments

---------

Co-authored-by: Yash Thakkar <[email protected]>
yash97 added a commit that referenced this pull request Mar 26, 2025
* Centralized leaked ENI cleanup- CNINode CRD changes

* Centralized leaked ENI cleanup- refactor periodic cleanup & add node termination cleaner (#505)

* Centralized leaked ENI cleanup- refactor periodic cleanup & add node termination cleaner

* defer updating metrics

* WIP commit no.3

* instance id as tag, not requeuing on node cleanup failure

* not requeing on node termination cleaner failure

* minor log change

* adding node termination failure metric

* minor test change

* using paginated calls to describe network interface while eni cleanup

* refactor based on comments

---------

Co-authored-by: Yash Thakkar <[email protected]>

---------

Co-authored-by: sushrk <[email protected]>
Co-authored-by: Sushmitha Ravikumar <[email protected]>
haouc pushed a commit to haouc/amazon-vpc-resource-controller-k8s that referenced this pull request Apr 13, 2025
* Centralized leaked ENI cleanup- CNINode CRD changes

* Centralized leaked ENI cleanup- refactor periodic cleanup & add node termination cleaner (aws#505)

* Centralized leaked ENI cleanup- refactor periodic cleanup & add node termination cleaner

* defer updating metrics

* WIP commit no.3

* instance id as tag, not requeuing on node cleanup failure

* not requeing on node termination cleaner failure

* minor log change

* adding node termination failure metric

* minor test change

* using paginated calls to describe network interface while eni cleanup

* refactor based on comments

---------

Co-authored-by: Yash Thakkar <[email protected]>

---------

Co-authored-by: sushrk <[email protected]>
Co-authored-by: Sushmitha Ravikumar <[email protected]>
haouc pushed a commit that referenced this pull request Apr 14, 2025
* Centralized leaked ENI cleanup- CNINode CRD changes

* Centralized leaked ENI cleanup- refactor periodic cleanup & add node termination cleaner (#505)

* Centralized leaked ENI cleanup- refactor periodic cleanup & add node termination cleaner

* defer updating metrics

* WIP commit no.3

* instance id as tag, not requeuing on node cleanup failure

* not requeing on node termination cleaner failure

* minor log change

* adding node termination failure metric

* minor test change

* using paginated calls to describe network interface while eni cleanup

* refactor based on comments

---------

Co-authored-by: Yash Thakkar <[email protected]>

---------

Co-authored-by: sushrk <[email protected]>
Co-authored-by: Sushmitha Ravikumar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants