operator/multi-pool: Streamline implementation and improve reusability#43937
Merged
pippolo84 merged 9 commits intocilium:mainfrom Jan 27, 2026
Merged
Conversation
Member
Author
|
/test |
f37c2de to
f5fc329
Compare
f5fc329 to
9f3f7d5
Compare
joamaki
approved these changes
Jan 27, 2026
Member
Author
|
/test |
The operator relies on a different module for each IPAM mode it supports. This means that there is no need for a common IPAM AllocatorProvider interface anymore, since each implementation is completely independent from the others. Therefore, remove the stale unused interface. Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
Multi Pool IPAM mode requires both an operator component as well as an agent one. Currently, both components, despite being completely separate, are kept under pkg/ipam/allocator/multipool. Following the structure of other packages, move all the operator related logic under operator/pkg/ipam. This allows to recognize at a glance if a certain portion of the code is part of the agent or part of the operator. Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
The PooledAllocatorProvider interface was meant to abstract the use of concrete pooled allocators (like multipool.Allocator) into the IP Pools watcher. Since the multipool allocator is the only concrete implementation, in order to reduce the complexity, remove the interface and use the type directly. Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
In order to generalize the multi pool IPAM implementation and make it reusable for the upcoming multi pool Resource IPAM for the Network Driver, let's remove the direct reference to the CiliumNode resource in both the PoolAllocator and the NodeHandler. Both flavors of multi pool IPAM reads and writes to the CiliumNode, but using different fields: - the existing Pod IPAM relies on Spec.IPAM.Pools - the upcoming Resource IPAM relies on Spec.IPAM.ResourcePools but since the type of those fields is the same, it is possible to reuse the same multi pool implementation simply passing the proper pools reference from each module. Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
The ciliumNodeUpdateImplementation struct was meant to simplify the interactions with the CiliumNode resource in each different IPAM implementation (multi-pool, cluster-pool, ENI and so on). Since all the IPAM operator subsystem is now implemented as a hive cell and each IPAM flavor has an independent implementation with a reference to the dependecy-injected ClientSet, the abstraction is not useful anymore. In order to simplify the multi-pool implementation, let's use the ClientSet directly. Moreover, this removes the redundant double check for equality of the old and new version of the resource done with DeepEqual when calling Update and UpdateStatus. Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
Since those CIDRs will be used in the context of multi pool Resource IPAM too, where we allocate addresses to DRA resources, let's avoid mentioning "Pod" in the type name. Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
Just like in the previous commit, those CIDRSlices will be used in contexts where the allocated CIDRs will be used not by pods but by DRA resources, therefore remove "Pod" from the type name. Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
Just like the multi pool IPAM implementation, the auto creation of CiliumPodIPPool feature can be split into two parts: - a reusable set of functions to auto create pools based on a generic description - a set of functions that finalize the creation of the pools in a specific kind of k8s object While the first part could be reused for auto creation of multi pool Resource IPAM pools too (that is, for CiliumResourceIPPool objects), the second one implements the creation of pools specific for multi pool Pod IPAM, namely CiliumPodIPPool objects. The commit move the pod specific part into the multi pool cell for Pods IPAM. Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
This allows to reuse the code to handle pool events in multipool package in the upcoming multi pool Resource IPAM too. Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
9f3f7d5 to
cdda6e1
Compare
Member
Author
|
/test |
This was referenced Jan 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In preparation for the upcoming Multi Pool Resource IPAM for the Cilium Network Driver (see the CfP for more information) this PR aims to:
The PR does not intend to change anything regarding the current behavior of multi pool IPAM.
Note to reviewers: please review each commit individually
Depends on
#43693and#43726