Repository navigation
Rework podCIDR allocation - #209
Conversation
|
Proposal, as discussed: old: new: |
The `metal.ironcore.dev/loopback-address` annotation (a host IP) is replaced by `metadata.metal.ironcore.dev/prefix`, which carries the prefix allocated for the Node in CIDR notation. By convention, the first usable host IP of the prefix is assigned to the Node itself and reported as its internal IP address. Signed-off-by: Martin Kalcok <martin.kalcok@sap.com>
9313cc7 to
f9ce255
Compare
f9ce255 to
e26f684
Compare
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
|
PR title and description have been updated to reflect changes based on the previous review commits. |
|
LGTM. Though, let's have a manual test in a dev environment first |
e26f684 to
105bb6a
Compare
Instead of deriving the podCIDR from the Node's NodeInternalIP status address, source it from the prefix annotation of the Server backing the Node. The ServerClaim resolution from the Node's providerID is extracted into getServerClaimForNode and performed once per reconciliation, with the claim passed to both reconcilePodCIDR and reconcileMaintenance. Signed-off-by: Martin Kalcok <martin.kalcok@sap.com>
The previous approach to generating a node's podCIDR was to apply a mask to the node's assigned prefix. This could result in a collision, as the node's own IP would typically be the first address of the prefix, and as such, also part of the podCIDR. Any CNI using the podCIDR as an address pool could assign the node's IP address to one of the pods. The new approach increments the network portion of the IP address after applying the mask. This avoids the collision with the node's own IP address. The podCIDR won't be applied if it falls outside of the node's assigned prefix. However, since the prefix length used for podCIDR is typically way smaller than the prefix assigned to the entire host, this should not be a common issue. Example: Old approach Node prefix : 2001:db8::/64 Node IP : 2001:db8::1 podCIDR prefix: /112 podCIDR : 2001:db8::/112 <--- Overlaps the Node's IP New approach: Node prefix : 2001:db8::/64 Node IP : 2001:db8::1 podCIDR prefix: /112 podCIDR : 2001:db8::1:0/112 Signed-off-by: Martin Kalcok <martin.kalcok@sap.com>
105bb6a to
aa70291
Compare
|
I also manually tested the change by manually deploying a new zone and the offset mechanism works /cc @damyan |
maxmoehl
left a comment
There was a problem hiding this comment.
Thank you! Though you will need a metal maintainer to actually be able to merge this.
|
muh beautiful commits 😢 |
Please don't squash on merge.
After a follow-up request on the original proposal, this PR deals with two related topics across three distinct commits:
metal.ironcore.dev/loopback-addressannotation withmetadata.metal.ironcore.dev/prefixpodCIDRfrommetadata.metal.ironcore.dev/prefix, instead of the Server statuspodCIDRto avoid collision with node's own internal IPFor ease of review, I recommend taking a look at each commit individually.