ipam: allow /32 and /128 IP pools #34618
Conversation
|
Commits 34179f1, 9d68e1f do not match "(?m)^Signed-off-by:". Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin |
9d68e1f to
2f0b65c
Compare
2f0b65c to
f580d52
Compare
|
/test |
There was a problem hiding this comment.
Thanks for your PR!
This is clever, but I would prefer it if we removed the "first-last" limitation in general via an opt-in flag, not just for /32 or /128 CIDRs. Similarly to how lifted that restriction for LBIPAM, where it is configurable in the pool: #26488 (comment)
However, I'm fine to merge this approach, since it is a small improvement in the right direction (since /32 and /128 CIDRs are completely unusable at the moment). I've left some minor feedback
4ff5320 to
7c41c76
Compare
|
Hi @gandro, thanks for the feedback. I'm not confident enough with making changes to the API (yet), but I agree it should be aligned with the LBIPAM pool in the future. Regarding your feedback, I did the following changes:
Btw, I used |
|
/test |
|
Please note, the go linter is failing with the following error: |
|
Would it be possible the "waste first and last" IP range size be configurable? Because we give out /28 or /29 to ip pools (because most nodes run around 10 pods at max anyways) so it would be wasting quite a few IPs. Also it would solve the forever issue of being it configurable if. Or is it too much of a problem? |
Yes. This is what I have proposed here: #34618 (review) I strongly feel that this option to relax the first-last-restriction should be per pool, and not global. The only reason we do it for very small pools globally and by default is that they are not usable otherwise. However, @juliusmh has already mentioned that no changes to the CRD are planned in this PR. Changes to the API thus will require additional contributions not expected of this PR here. |
|
Technically this would also apply to /31 and /127 prefixes as well? |
As mentioned here #34618 (comment) this PR does this now. |
|
I triaged CI. Most issues are flakes, but there appear to be two real issues. Could you take a look @juliusmh? Thanks!
|
7c41c76 to
67190b3
Compare
|
|
/test |
Mostly getting CI green. I have seen the gink-go tests failing across multiple PRs, not sure if the test has been fixed already. Best cause of action is to rebase on the main branch to get the latest fixes and we will try to run CI again to see if that does it. |
Signed-off-by: Julius Hinze <[email protected]>
Signed-off-by: Julius Hinze <[email protected]>
67190b3 to
c1d429e
Compare
|
/test |
|
Just |
Extend `NewCIDRRange` with a `WithAllowFirstLastIPs` functional option that includes the first and last IPs of a CIDR in the allocatable range. This is needed for AWS ENI prefix delegation where /28 prefixes are exclusively assigned to a node and all 16 IPs are usable as there is no shared network segment requiring base/broadcast reservation. Also refactor `ForEach` to use `r.base` directly instead of assuming a +1 offset from the CIDR base, making it correct for both default and `AllowFirstLastIPs` ranges. Relates to [cilium/design-cfps#87](cilium/design-cfps#87) Followup to #34618 See #28637 (comment) Signed-off-by: Hadrien Patte <[email protected]>
Extend `NewCIDRRange` with a `WithAllowFirstLastIPs` functional option that includes the first and last IPs of a CIDR in the allocatable range. This is needed for AWS ENI prefix delegation where /28 prefixes are exclusively assigned to a node and all 16 IPs are usable as there is no shared network segment requiring base/broadcast reservation. Also refactor `ForEach` to use `r.base` directly instead of assuming a +1 offset from the CIDR base, making it correct for both default and `AllowFirstLastIPs` ranges. Relates to [cilium/design-cfps#87](cilium/design-cfps#87) Followup to #34618 See #28637 (comment) Signed-off-by: Hadrien Patte <[email protected]>
Extend `NewCIDRRange` with a `WithAllowFirstLastIPs` functional option that includes the first and last IPs of a CIDR in the allocatable range. This is needed for AWS ENI prefix delegation where /28 prefixes are exclusively assigned to a node and all 16 IPs are usable as there is no shared network segment requiring base/broadcast reservation. Also refactor `ForEach` to use `r.base` directly instead of assuming a +1 offset from the CIDR base, making it correct for both default and `AllowFirstLastIPs` ranges. Relates to [cilium/design-cfps#87](cilium/design-cfps#87) Followup to #34618 See #28637 (comment) Signed-off-by: Hadrien Patte <[email protected]>
This PR makes
CiliumPodIPPools that have mask /32 or /128 usable, not restricting the first and last addresses. This can be used to give Pods specific IP addresses. The only way to achieve this today is by requesting a /30 and blocking an unnecessary big chunk of the range.Commits:
Related: #17026 (fixed IP proposal)
Related: #28637