Skip to content

Multiple CAPI controllers on one CAPI management Cluster with Namespace Selector #13238

@jiangfwa

Description

@jiangfwa

What would you like to be added (User Story)?

As a operator, I would like to be able to install multiple CAPI controllers on one CAPI management cluster. Each CAPI controllers have its namespace selector to only reconcile the clusters under the selected namespaces.

Detailed Description

In the production, if there are more than 10+ openstack clusters, each cluster has around 1000+ nodes. The capi-controller and capo-controller are under heavy pressure.

In this case, my idea is to have multiple sets of capi-controllers, and sort the app clusters into multiple sets. Let each set of capi-controllers only manage its app clusters. For example, I can put the label on each Cluster resource and the namespace as following:

- namespace `cluster-a1` with label `env: alpha`
- namespace `cluster-a2` with label `env: alpha`
- namespace `cluster-b1` with label `env: beta`
- namespace `cluster-b2` with label `env: beta`
- namespace `cluster-p1` with label `env: prod`
- namespace `cluster-p2` with label `env: prod`

Then, if multiple sets of capi-controllers installed, and with the namespace selector, each capi-controller can work as the following:

- namespace: `capi-mgmnt-alpha`
    - capi-controller with namespace selector `env: alpha`
    - capa-controller with namespace selector `env: alpha`
    - capo-controller with namespace selector `env: alpha`
- namespace: `capi-mgmnt-beta`
    - capi-controller with namespace selector `env: beta`
    - capa-controller with namespace selector `env: beta`
    - capo-controller with namespace selector `env: beta`
- namespace: `capi-mgmnt-prod`
    - capi-controller with namespace selector `env: prod`
    - capa-controller with namespace selector `env: prod`
    - capo-controller with namespace selector `env: prod`

This can do some kind of load balancing on the reconciling of these clusters to multiple capi-controllers. For the CRD, all sets of the capi-controllers need to share the CRD, so the versions between these capi-controllers need to be the same or at least support the same version of CRDs.

Anything else you would like to add?

N/A

Label(s) to be applied

/kind feature
One or more /area label. See https://github.com/kubernetes-sigs/cluster-api/labels?q=area for the list of labels.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.needs-priorityIndicates an issue lacks a `priority/foo` label and requires one.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions