-
Notifications
You must be signed in to change notification settings - Fork 796
Description
What would you like to be added:
We should prevent ipamd from trying to free ENIs when a node is about to terminated.
For spot instances we could do something similar to the aws-node-termination-handler and check some metadata endpoints.
For the case where a node is cordoned off before being terminated, meaning it is marked as "unschedulable", we should be able to check this node taints before trying to attach or detach any ENIs.
Why is this needed:
Since there is no EC2 API call to directly "delete" an ENI that is attached, instead they first have to be detached, which takes a few seconds, then deleted. If the instance gets terminated after the ENI has been detached, but before it has been deleted, it will be leaked. This leaked ENI can prevent Security Groups and VPCs from being deleted and require manual clean up.