-
Notifications
You must be signed in to change notification settings - Fork 71
[improvement][feat] Deterministic IPv6 /112 PodCIDR via :0:c::/112; update tests/docs #439
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
Conversation
…pdate tests/docs - Add computeStableIPv6PodCIDR() to derive a stable /112 from a node’s /64 using mnemonic subprefix :0:c::/112. - allocateIPv6CIDR(): prefer stable subprefix when mask=112 and base is /64; otherwise fall back to start-of-range masking. - Update tests in cloud/nodeipam/ipam/cloud_allocator_test.go to expect 2300:5800:2:1:0:c::/112. - Document behavior and correct example flag to --node-cidr-mask-size-ipv6=112 in docs/configuration/nodeipam.md. - Add/adjust debug logs for clarity; no change to IPv4 behavior.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #439 +/- ##
==========================================
+ Coverage 71.87% 71.88% +0.01%
==========================================
Files 19 19
Lines 3598 3625 +27
==========================================
+ Hits 2586 2606 +20
- Misses 773 779 +6
- Partials 239 240 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces deterministic IPv6 PodCIDR allocation using a stable mnemonic subprefix :0:c::/112 within a node's /64 IPv6 range. The change ensures consistent PodCIDR assignment across restarts while maintaining backward compatibility.
- Implements
computeStableIPv6PodCIDR()function to derive stable /112 subnets from /64 base ranges - Updates allocation logic to prefer stable subprefix when conditions are met, falling back to original behavior otherwise
- Corrects documentation example and updates test expectations to reflect the new deterministic behavior
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| cloud/nodeipam/ipam/cloud_allocator.go | Adds stable IPv6 PodCIDR computation logic and updates allocation method |
| cloud/nodeipam/ipam/cloud_allocator_test.go | Updates test expectations to use new deterministic IPv6 addresses |
| docs/configuration/nodeipam.md | Documents new behavior and corrects configuration example |
Co-authored-by: Copilot <[email protected]>
AshleyDumaine
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements deterministic IPv6 PodCIDR allocation using a stable mnemonic subprefix :0:c::/112 to derive /112 subnets from node /64 IPv6 ranges. This ensures consistent IPv6 pod networking across node restarts and deployments.
- Adds
getIPv6PodCIDR()function to compute stable /112 PodCIDRs using mnemonic subprefix:0:c::/112 - Updates
allocateIPv6CIDR()to prefer stable allocation when conditions are met, with fallback to original behavior - Updates all test expectations and documentation to reflect the new stable IPv6 allocation behavior
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| cloud/nodeipam/ipam/cloud_allocator.go | Core implementation adding stable IPv6 PodCIDR computation with mnemonic subprefix |
| cloud/nodeipam/ipam/cloud_allocator_test.go | New test for stable IPv6 function and updated expected values across existing tests |
| docs/configuration/nodeipam.md | Documentation updates explaining stable IPv6 behavior and correcting example flag value |
… slice. In go, when passing non pointer var that are slices, maps, or channels, it just makes a copy of the obj header and not the underlying data. Since this passed ip can be used in the fallback logic, we need to make sure we copy it so there is no bug in future.
General:
Pull Request Guidelines: