operator: Modularize IPAM allocators#43628
Merged
pippolo84 merged 9 commits intocilium:mainfrom Jan 21, 2026
Merged
Conversation
982238e to
c3adc56
Compare
This comment was marked as outdated.
This comment was marked as outdated.
c3adc56 to
40181ed
Compare
This comment was marked as outdated.
This comment was marked as outdated.
537e913 to
96f08d5
Compare
This comment was marked as outdated.
This comment was marked as outdated.
96f08d5 to
946ecaa
Compare
Member
Author
|
/test |
Add a cell to implement the multipool allocator. Since the allocator now lives in its own specific cell, it is possible to avoid the type assertion previously used in operator/cmd/root.go and directly start the IP pool handler. Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
ParallelAllocWorkers is a configuration option used in both AWS and Azure allocators, therefore it is declared as a cell.Config in the operator IP allocator provide cell. Azure and AWS allocators will be added in a subsequent commit and will relay on this shared config. Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
Add a cell to implement the AlibabaCloud allocator. Also, make the AlibabaCloud operator options part of the cell configuration. The value of those options are passed down to the AlibabaCloud allocator. The allocator still uses the global defined option values: this will be updated in a subsequent commit where the old operator IPAM allocator code will be removed. Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
Add a cell to implement the AWS allocator. Also, make the AWS operator options part of the cell configuration. The value of those options are passed down to the AWS allocator. The allocator still uses the global defined option values: this will be updated in a subsequent commit where the old operator IPAM allocator code will be removed. AWSMaxResultsPerCall and AWSPaginationEnabled options are kept in the old file and added through the flags hooks. This is done in order to keep the backward compatibility with the AWSPaginationEnabled logic, that requires to check if the option is explicitly set. Since a reference to the viper instance is needed for that, and the hive does not expose it, we keep them as is for now. Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
Add a cell to implement the Azure allocator. Also, make the Azure operator options part of the cell configuration. The value of those options are passed down to the Azure allocator. The allocator still uses the global defined option values: this will be updated in a subsequent commit where the old operator IPAM allocator code will be removed. Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
Move TestPodCIDRAllocatorOverlap to operator/pkg/ipam alongside the CiliumNode watcher implementation. Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
Remove the old code to start the needed IPAM allocator in favor of the new modular implementation. Also, remove all the global options specific to a particular IPAM mode to rely on the options defined in the cells and fix the tests accordingly. Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
f5e7133 to
8d655a6
Compare
Member
Author
|
Tried an alternative approach to avoid the ugly *_placeholder.go files. I'll leave it as a follow-up PR for now to avoid changing the code here once again. |
Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
8d655a6 to
cce54a0
Compare
aanm
approved these changes
Jan 15, 2026
Member
Author
|
@liyihuang @tamilmani1989 gentle ping for the review 🙏 |
Contributor
|
LGTM. For AWSMaxResultsPerCall and AWSPaginationEnabled. I guess we will move it to the cell in 1.20. Am I right? Is there any way that we can track it so we can remember to do that in 1.20? |
liyihuang
approved these changes
Jan 16, 2026
Member
Author
Already opened #43693 |
Member
Author
|
/test |
tommyp1ckles
approved these changes
Jan 20, 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.
Modularize the operator IPAM allocators.
In order to reduce the operator binary size, the allocators are built selectively, depending on the defined build tags. This logic is kept in this refactor too: we rely on a
cell.Groupto include all the allocators, and for each one two versions of the cell are defined:Notes to reviewers: please review each commit individually