Skip to content

Commit ec98aa5

Browse files
authored
Merge pull request #4690 from mikemorris/kep4322-crd-scope
KEP-4322: add CRD scope explanation to alternatives considered section
2 parents 4366c62 + c6ced19 commit ec98aa5

11 files changed

+66
-0
lines changed

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

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,15 @@ tags, and then generate with `hack/update-toc.sh`.
129129
- [Implementation History](#implementation-history)
130130
- [Drawbacks](#drawbacks)
131131
- [Alternatives](#alternatives)
132+
- [Extending Cluster API <code>Cluster</code> resource](#extending-cluster-api-cluster-resource)
133+
- [ClusterProfile CRD scope](#clusterprofile-crd-scope)
134+
- [Global hub cluster for multiple clustersets](#global-hub-cluster-for-multiple-clustersets)
135+
- [Global hub cluster per clusterset](#global-hub-cluster-per-clusterset)
136+
- [Regional hub cluster for multiple clustersets](#regional-hub-cluster-for-multiple-clustersets)
137+
- [Regional hub clusters per clusterset](#regional-hub-clusters-per-clusterset)
138+
- [Self-assembling clustersets](#self-assembling-clustersets)
139+
- [Workload placement across multiple clusters <em>without</em> cross-cluster service networking](#workload-placement-across-multiple-clusters-without-cross-cluster-service-networking)
140+
- [Workload placement into a specific clusterset](#workload-placement-into-a-specific-clusterset)
132141
- [Infrastructure Needed (Optional)](#infrastructure-needed-optional)
133142
<!-- /toc -->
134143

@@ -1028,6 +1037,8 @@ What other approaches did you consider, and why did you rule them out? These do
10281037
not need to be as detailed as the proposal, but should include enough
10291038
information to express the idea and why it was not acceptable.
10301039
-->
1040+
1041+
### Extending Cluster API `Cluster` resource
10311042
We also considered the possibility of extending the existing Cluster API's
10321043
[Cluster](https://github.com/kubernetes-sigs/cluster-api/blob/v1.6.2/api/v1beta1/cluster_types.go#L39)
10331044
resource to accommodate our needs for describing clusters within a multi-cluster
@@ -1044,6 +1055,56 @@ Cluster is primarily owned by platform administrators focused on provisioning cl
10441055
whereas the new API is designed to be owned by the cluster manager that created the
10451056
cluster it represents.
10461057

1058+
### ClusterProfile CRD scope
1059+
1060+
We had [extensive discussions](https://docs.google.com/document/d/1E_z3ti-d-modwnhsvR3yBZwX4rRpL26dKkl41YAptRo/edit)
1061+
in SIG-Multicluster meetings about the appropriate scope for ClusterProfile
1062+
resources, and ultimately decided that namespace scope would be more flexible
1063+
than cluster scope while still retaining an adequate UX for simpler usage
1064+
patterns. As a historical note, a prior attempt at organizing multiple
1065+
clusters, the ClusterRegistry proposal, had proposed cluster-scoped resources
1066+
but was met with pushback by potential adopters in part due to a desire to host
1067+
multiple distinct registry lists on a single control plane, which would be far
1068+
more straightforward with namespaced resources.
1069+
1070+
#### Global hub cluster for multiple clustersets
1071+
1072+
![illustration of global hub for multiple clustersets topology](./global-hub.svg)
1073+
1074+
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.
1075+
1076+
#### Global hub cluster per clusterset
1077+
1078+
![illustration of global hub per clusterset topology](./global-hub-per-clusterset.svg)
1079+
1080+
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.
1081+
1082+
#### Regional hub cluster for multiple clustersets
1083+
1084+
![illustration of regional hub clusters for multiple clustersets topology](./regional-hub-multiple-clustersets.svg)
1085+
1086+
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.
1087+
1088+
#### Regional hub clusters per clusterset
1089+
1090+
![illustration of regional hub clusters per clusterset topology](./regional-hub-per-clusterset.svg)
1091+
1092+
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.
1093+
1094+
#### Self-assembling clustersets
1095+
1096+
![illustration of self-assembling clusterset topology](./self-assembling-clustersets.svg)
1097+
1098+
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.
1099+
1100+
#### Workload placement across multiple clusters _without_ cross-cluster service networking
1101+
1102+
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.
1103+
1104+
#### Workload placement into a specific clusterset
1105+
1106+
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.
1107+
10471108
## Infrastructure Needed (Optional)
10481109

10491110
<!--
63.3 KB
Loading

keps/sig-multicluster/4322-cluster-inventory/global-hub-per-clusterset.svg

Lines changed: 1 addition & 0 deletions
Loading
60.7 KB
Loading

keps/sig-multicluster/4322-cluster-inventory/global-hub.svg

Lines changed: 1 addition & 0 deletions
Loading
52 KB
Loading

keps/sig-multicluster/4322-cluster-inventory/regional-hub-multiple-clustersets.svg

Lines changed: 1 addition & 0 deletions
Loading
58.9 KB
Loading

keps/sig-multicluster/4322-cluster-inventory/regional-hub-per-clusterset.svg

Lines changed: 1 addition & 0 deletions
Loading
39.9 KB
Loading

0 commit comments

Comments
 (0)