Skip to content

Commit da34187

Browse files
committed
kep-4322: add cluster-scoped crd to alternatives section
1 parent 382fe4b commit da34187

File tree

1 file changed

+41
-0
lines changed
  • keps/sig-multicluster/4322-cluster-inventory

1 file changed

+41
-0
lines changed

keps/sig-multicluster/4322-cluster-inventory/README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,6 +1028,8 @@ What other approaches did you consider, and why did you rule them out? These do
10281028
not need to be as detailed as the proposal, but should include enough
10291029
information to express the idea and why it was not acceptable.
10301030
-->
1031+
1032+
### Extending Cluster API `Cluster` resource
10311033
We also considered the possibility of extending the existing Cluster API's
10321034
[Cluster](https://github.com/kubernetes-sigs/cluster-api/blob/v1.6.2/api/v1beta1/cluster_types.go#L39)
10331035
resource to accommodate our needs for describing clusters within a multi-cluster
@@ -1044,6 +1046,45 @@ Cluster is primarily owned by platform administrators focused on provisioning cl
10441046
whereas the new API is designed to be owned by the cluster manager that created the
10451047
cluster it represents.
10461048

1049+
### Cluster-scoped ClusterProfile CRD
1050+
1051+
We had [extensive discussions](https://docs.google.com/document/d/1E_z3ti-d-modwnhsvR3yBZwX4rRpL26dKkl41YAptRo/edit)
1052+
in SIG-Multicluster meetings about the appropriate scope for ClusterProfile
1053+
resources, and ultimately decided that namespace scope would be more flexible
1054+
than cluster scope while still retaining an adequate UX for simpler usage
1055+
patterns. As a historical note, a prior attempt at organizing multiple
1056+
clusters, the ClusterRegistry proposal, had proposed cluster-scoped resources
1057+
but was met with pushback by potential adopters in part due to a desire to host
1058+
multiple distinct registry lists on a single control plane, which would be far
1059+
more straightforward with namespaced resources.
1060+
1061+
#### Global hub cluster for multiple clustersets
1062+
1063+
In this model, a single global hub cluster is used to manage multiple clustersets (a "Prod" clusterset and "Dev" clusterset in this illustration). For this use case, some means of segmenting the ClusterProfile resources into distinct groups for each clusterset is needed, and ideally should facilitate selecting all ClusterProfiles of a given clusterset. Because of this selection-targeting goal, setting clusterset membership within the `spec` of a ClusterProfile would not be sufficient. While setting a label such as the proposed `clusterset.multicluster.x-k8s.io` on the ClusterProfile resource (instead of a namespace) could be acceptable, managing multiple cluster-scoped ClusterProfile resources for multiple unrelated clustersets on a single global hub could quickly get cluttered. In addition to grouping clarity, namespace scoping could allow RBAC delegation for separate teams to manage resources for their own clustersets in isolation while still using a shared hub. The group of all clusters registered on the hub (potentially including clusters belonging to different clustersets or clusters not belonging to any clusterset) may represent a single "inventory" or multiple inventories, but such a definition is beyond the scope of this document and is permissible to be an undefined implementation detail.
1064+
#### Global hub cluster per clusterset
1065+
1066+
In this model, each "inventory" has a 1:1 mapping with a clusterset containing clusters in multiple regions. A cluster-scoped ClusterProfile CRD would be sufficient for this architecture, but it requires a proliferation of hub clusters, which may not be optimal. This model is still implementable with namespace-scoped ClusterProfile CRDs by writing them all to a single namespace, either the `default` namespace or a specific namespace configured in the cluster manager. The risk of placing resources in the wrong namespace would be somewhat minimal if following the suggested pattern of having ClusterProfile resources be written by a "manager" rather than authored by humans.
1067+
1068+
#### Regional hub cluster for multiple clustersets
1069+
1070+
In this model, "hub" clusters are limited to a regional scope (potentially for architectural limitations or performance optimizations) and each hub is used to manage clusters only from the local region, but which may belong to separate clustersets. If, as in the pictured example, clustersets still span multiple regions, some out-of-band synchronization mechanism between the regional hubs would likely be needed. This model has similar segmentation needs to the global hub model, just at a smaller scale.
1071+
1072+
#### Regional hub clusters per clusterset
1073+
1074+
This is creeping pretty far towards excessive cluster proliferation (and cross-region coordination overhead) purely for management needs (as opposed to actually running workloads), and would be more likely to be a reference or testing implementation than an architecture suitable for production scale.
1075+
1076+
#### Self-assembling clustersets
1077+
1078+
This is the model most suited to a cluster-scoped ClusterProfile resource. In contrast to the prior models discussed, in this approach the ClusterProfile CRD would be written directly to each "member" cluster. ClusterSet membership would either be established through peer-to-peer relationships, or managed by an external control plane. For ClusterSet security and integrity, a two-way handshake of some sort would be needed between the local cluster and each peer or the external control plane to ensure it is properly authorized to serve endpoints for exported services or import services from other clusters. While these approaches could be implemented with a namespace-scoped ClusterProfile CRD in the `default` or a designated namespace, misuse is most likely in this model, because the resource would be more likely to be authored by a human if using the peer-to-peer model. Due to the complexity and fragility concerns of managing clusterset membership in a peer-to-peer topology, an external control plane would likely be preferable. Assuming the external control plane does not support Kubernetes APIs (if it did, any of the "hub" models could be applied instead), it could still be possible to implement this model with a namespace-scoped ClusterProfile resource, but it is _not_ recommended.
1079+
1080+
#### Workload placement across multiple clusters _without_ cross-cluster service networking
1081+
1082+
In this model, a consumer of the Cluster Inventory API is looking to optimize workload placement to take advantage of excess capacity on existing managed clusters. These workloads may have specific hardware resource needs such as GPUs, but are typically "batch" jobs that do not require multi-cluster service networking to communicate with known services in a specific clusterset. The isolated nature of these jobs could allow them to be scheduled on many known clusters regardless of clusterset membership. A centralized hub which could register clusters in disparate clustersets or no clusterset and return a list of all known clusters from a single API call would be the most efficient for this consumer to query. Namespaced ClusterProfile CRDs on a global hub would be the best fit for this use case.
1083+
1084+
#### Workload placement into a specific clusterset
1085+
1086+
Within a single clusterset, a global workload placement controller may seek to balance capacity across multiple regions in response to demand, cost efficiency, or other factors. Querying a list of all clusters within a single clusterset should be possible to serve this use case, which is amenable to either cluster-scoped or namespaced-scoped ClusterProfile CRDs.
1087+
10471088
## Infrastructure Needed (Optional)
10481089

10491090
<!--

0 commit comments

Comments
 (0)