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

Use unreserved IP address for pod ENI #3087

Closed
alam0rt opened this issue Oct 24, 2024 · 2 comments
Closed

Use unreserved IP address for pod ENI #3087

alam0rt opened this issue Oct 24, 2024 · 2 comments

Comments

@alam0rt
Copy link

alam0rt commented Oct 24, 2024

Problem:

We use ENABLE_POD_ENI=true and ENABLE_PREFIX_DELEGATION=true to create a secondary ENI attached to our nodes in a dedicated subnet.

These subnets also have a number of CIDR reservations which we use for pods.

The issue we face is that randomly the primary address of the secondary ENI falls within the reserved CIDR ranges. This means more fragmentation of the subnet and wasted IP space. I am pretty sure that the reservation range that the primary address falls in becomes unusable for pods.

A solution?:

Looking at the code in

input := &ec2.CreateNetworkInterfaceInput{}
if cache.enablePrefixDelegation {
input = &ec2.CreateNetworkInterfaceInput{
Description: aws.String(eniDescription),
Groups: aws.StringSlice(cache.securityGroups.SortedList()),
SubnetId: aws.String(cache.subnetID),
TagSpecifications: tagSpec,
Ipv4PrefixCount: aws.Int64(int64(needIPs)),
}
} else {
input = &ec2.CreateNetworkInterfaceInput{
Description: aws.String(eniDescription),
Groups: aws.StringSlice(cache.securityGroups.SortedList()),
SubnetId: aws.String(cache.subnetID),
TagSpecifications: tagSpec,
SecondaryPrivateIpAddressCount: aws.Int64(int64(needIPs)),
}
}
I can see that it doesn't request a specific address. Is it possible / a good idea to allow selecting a primary address from a range that is outside of any CIDR reservation?

@alam0rt
Copy link
Author

alam0rt commented Oct 24, 2024

Closing as #2313 is identical

@alam0rt alam0rt closed this as completed Oct 24, 2024
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.

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

1 participant