Skip to content

operator: Modularize IPAM allocators#43628

Merged
pippolo84 merged 9 commits intocilium:mainfrom
pippolo84:pr/pippolo84/modularize-operator-allocator
Jan 21, 2026
Merged

operator: Modularize IPAM allocators#43628
pippolo84 merged 9 commits intocilium:mainfrom
pippolo84:pr/pippolo84/modularize-operator-allocator

Conversation

@pippolo84
Copy link
Copy Markdown
Member

@pippolo84 pippolo84 commented Jan 8, 2026

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.Group to include all the allocators, and for each one two versions of the cell are defined:

  • a placeholder one: an empty cell to be able to build the operator when the related tag is not defined
  • the real one: the cell implementing the actual allocator for the specific mode, to be included when the build tag is defined

Notes to reviewers: please review each commit individually

@pippolo84 pippolo84 added area/operator Impacts the cilium-operator component release-note/misc This PR makes changes that have no direct user impact. area/modularization Relates to code modularization and maintenance. area/ipam IP address management, including cloud IPAM labels Jan 8, 2026
@pippolo84 pippolo84 force-pushed the pr/pippolo84/modularize-operator-allocator branch 4 times, most recently from 982238e to c3adc56 Compare January 8, 2026 17:58
@pippolo84

This comment was marked as outdated.

@joestringer joestringer added the dont-merge/wait-until-release Freeze window for current release is blocking non-bugfix PRs label Jan 8, 2026
@pippolo84 pippolo84 force-pushed the pr/pippolo84/modularize-operator-allocator branch from c3adc56 to 40181ed Compare January 9, 2026 11:47
@pippolo84

This comment was marked as outdated.

@pippolo84 pippolo84 force-pushed the pr/pippolo84/modularize-operator-allocator branch 2 times, most recently from 537e913 to 96f08d5 Compare January 9, 2026 18:39
@pippolo84

This comment was marked as outdated.

@pippolo84 pippolo84 force-pushed the pr/pippolo84/modularize-operator-allocator branch from 96f08d5 to 946ecaa Compare January 9, 2026 21:46
@pippolo84 pippolo84 changed the title operator: Modularize IPAM operator: Modularize IPAM allocators Jan 9, 2026
@pippolo84
Copy link
Copy Markdown
Member Author

/test

@pippolo84 pippolo84 marked this pull request as ready for review January 9, 2026 21:58
@pippolo84 pippolo84 requested review from a team as code owners January 9, 2026 21:58
@pippolo84 pippolo84 requested a review from a team as a code owner January 12, 2026 15:05
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>
@pippolo84 pippolo84 force-pushed the pr/pippolo84/modularize-operator-allocator branch from f5e7133 to 8d655a6 Compare January 13, 2026 14:47
@pippolo84
Copy link
Copy Markdown
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>
@pippolo84 pippolo84 force-pushed the pr/pippolo84/modularize-operator-allocator branch from 8d655a6 to cce54a0 Compare January 13, 2026 14:54
@aanm aanm removed the dont-merge/wait-until-release Freeze window for current release is blocking non-bugfix PRs label Jan 14, 2026
@pippolo84
Copy link
Copy Markdown
Member Author

@liyihuang @tamilmani1989 gentle ping for the review 🙏

@liyihuang
Copy link
Copy Markdown
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?

@pippolo84
Copy link
Copy Markdown
Member Author

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?

Already opened #43693
I left this as is to avoid increasing complexity even more while it was already opened for review.

@pippolo84
Copy link
Copy Markdown
Member Author

/test

@pippolo84 pippolo84 removed the request for review from tamilmani1989 January 21, 2026 09:03
@pippolo84 pippolo84 added this pull request to the merge queue Jan 21, 2026
Merged via the queue into cilium:main with commit da167eb Jan 21, 2026
86 of 90 checks passed
@pippolo84 pippolo84 deleted the pr/pippolo84/modularize-operator-allocator branch January 21, 2026 09:16
@maintainer-s-little-helper maintainer-s-little-helper bot added ready-to-merge This PR has passed all tests and received consensus from code owners to merge. labels Jan 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ipam IP address management, including cloud IPAM area/modularization Relates to code modularization and maintenance. area/operator Impacts the cilium-operator component ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/misc This PR makes changes that have no direct user impact.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants