Skip to content

Feat: Add Multi-Tenant Manager to CCM #935

Open
priyapande wants to merge 4 commits intokubernetes:masterfrom
priyapande:ccm-poc
Open

Feat: Add Multi-Tenant Manager to CCM #935
priyapande wants to merge 4 commits intokubernetes:masterfrom
priyapande:ccm-poc

Conversation

@priyapande
Copy link

@priyapande priyapande commented Dec 5, 2025

Add support for a tenant controller manager that launches node controllers separately for each tenant that are scoped to it's tenant authentication & filtered nodes view.

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Dec 5, 2025
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If the repository mantainers determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Dec 5, 2025
@k8s-ci-robot
Copy link
Contributor

Welcome @priyapande!

It looks like this is your first PR to kubernetes/cloud-provider-gcp 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/cloud-provider-gcp has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Dec 5, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @priyapande. Thanks for your PR.

I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added sig/network Categorizes an issue or PR as relevant to SIG Network. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Dec 5, 2025
@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 6, 2025
@bowei
Copy link
Member

bowei commented Dec 8, 2025

/assign

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 10, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: priyapande
Once this PR has been reviewed and has the lgtm label, please ask for approval from bowei. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@bowei
Copy link
Member

bowei commented Dec 10, 2025

Can we split off the vendor change in a separate commit? Right now it's 300 files, but I'm assuming most of it is in vendor/

Comment on lines 77 to 85
klog.Infof("[%s] Creating OSS Cloud Node Controller...", pcKey)
nodeController, err := node.NewCloudNodeController(
filteredFactory.Core().V1().Nodes(),
m.kubeClient,
scopedCloud,
m.config.ComponentConfig.NodeStatusUpdateFrequency.Duration,
m.config.ComponentConfig.NodeController.ConcurrentNodeSyncs,
)
if err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there has to be two independent launchers, and users should opt-in via the standards flags to enable one or other controllers, check this for prior art https://github.com/kubernetes/cloud-provider-gcp/pull/895/files

The litmus test is that the addition of this new controller/folder will have zero impact, and the behavior is governed by the flags

@aojea
Copy link
Member

aojea commented Dec 10, 2025

We met offline, to summarize our discussion, try to follow the same approached used in #895

  • leverage the initializers behavior to have two different nodecontrollers, with the new one disabled by default, this will allow users to use the existing flags semantics to enable or disable one or other controller

--controllers strings     Default: "*"
--
  | A list of controllers to enable. '*' enables all on-by-default controllers, 'foo' enables the controller named 'foo', '-foo' disables the controller named 'foo'.All controllers: bootstrap-signer-controller, certificatesigningrequest-a

  • avoid mixing code as much as possible:
  • prefix files on shared folders eg. cmd/gkemultinodecontroller.go
  • prefix folders that are not shared with oss code eg. /pkg/controller/gkenodemanager
  • do not export libraries , if some library needs to be exported within the project just nest it under internal eg./pkg/internal/informers
  • do not commit generated libraries or CRDs or any other type of API , instead use an external repository and revendor it here , see use the GKE networking CRDs from GoogleCloudPlatform platform repo #725

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 15, 2025
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 2, 2026
@priyapande priyapande changed the title CCM-MT Poc Feat: Add MultiTenant Manager to CCM Feb 3, 2026
@priyapande priyapande changed the title Feat: Add MultiTenant Manager to CCM Feat: Add Multi-Tenant Manager to CCM Feb 3, 2026
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 5, 2026
@priyapande priyapande force-pushed the ccm-poc branch 2 times, most recently from 92f9007 to 6b804f7 Compare February 5, 2026 20:26
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 5, 2026
@priyapande priyapande marked this pull request as ready for review February 5, 2026 20:27
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 5, 2026
@k8s-ci-robot k8s-ci-robot requested a review from cheftako February 5, 2026 20:28
@priyapande priyapande requested a review from aojea February 5, 2026 20:28
@priyapande priyapande force-pushed the ccm-poc branch 3 times, most recently from 66e6b19 to b00b173 Compare February 6, 2026 01:29
klog.Errorf("Failed to create network client: %v", err)
return nil, false, err
}
networkInformerFactory := networkinformers.NewSharedInformerFactory(networkClient, 12*time.Hour)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we doing this resync every 12 hours on purpose? this has created some internal issues in other. controllers and nobody was able to explain me the reason to add this .. if we want to periodically go over the elements in the cache then this should be much lower, if we do not need that then this should be 0

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a valid point, changed it to zero as the controller can rely on the event stream to process the required changes and a full walkthrough of cache isn't necessary. Thanks


// StartNodeIpamController starts the NodeIPAM controller.
// It returns the controller interface, a boolean indicating if it started, and an error if any.
func StartNodeIpamController(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it feels like this nodeipam starts should not be mixed in the same commit or even the same PR, if something goes wrong we have to revert the whole thing

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved refactoring & vendor logic to separate PR - #966

@priyapande priyapande force-pushed the ccm-poc branch 3 times, most recently from 9e538fd to 088172d Compare February 9, 2026 02:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. sig/network Categorizes an issue or PR as relevant to SIG Network. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants