Skip to content

Commit cf37028

Browse files
committed
Update with feedback
Signed-off-by: Marvin Beckers <[email protected]>
1 parent 120cef5 commit cf37028

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

designs/multi-cluster.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ objects. This proposal is about adding native support for multi-cluster use-case
3838
to controller-runtime.
3939

4040
With this change, it will be possible to implement pluggable cluster providers
41-
that automatically start and stop watches (and thus, cluster-aware reconcilers) when
41+
that automatically start and stop sources (and thus, cluster-aware reconcilers) when
4242
the cluster provider adds ("engages") or removes ("disengages") a cluster.
4343

4444
## Motivation
@@ -58,19 +58,18 @@ This change is important because:
5858

5959
- Provide an interface for plugging in a "cluster provider", which provides a dynamic set of clusters that should be reconciled by registered controllers.
6060
- Provide a way to natively write controllers that
61-
1. (UNIFORM MULTI-CLUSTER CONTROLLER) operate on multiple clusters in a uniform way,
61+
1. use the cluster provider Go interface that can be implemented by 3rd parties outside of controller-runtime to adapt an existing multi-cluster-compatible code-base to a concrete environment.
62+
2. (UNIFORM MULTI-CLUSTER CONTROLLER) operate on multiple clusters in a uniform way,
6263
i.e. reconciling the same resources on multiple clusters, **optionally**
6364
- sourcing information from one central hub cluster
6465
- sourcing information cross-cluster.
6566

6667
Example: distributed `ReplicaSet` controller, reconciling `ReplicaSets` on multiple clusters.
67-
2. (AGGREGATING MULTI-CLUSTER CONTROLLER) operate on one central hub cluster aggregating information from multiple clusters.
68+
3. (AGGREGATING MULTI-CLUSTER CONTROLLER) operate on one central hub cluster aggregating information from multiple clusters.
6869

6970
Example: distributed `Deployment` controller, aggregating `ReplicaSets` across multiple clusters back into a central `Deployment` object.
7071
- Allow clusters to dynamically join and leave the set of clusters a controller operates on.
7172
- Allow logical clusters where a set of clusters is actually backed by one physical informer store.
72-
- Allow 3rd-parties to plug in their multi-cluster adapter (in source code) into
73-
an existing multi-cluster-compatible code-base.
7473
- Minimize the amount of changes to make a controller-runtime controller
7574
multi-cluster-compatible, in a way that 3rd-party projects have no reason to
7675
object these kind of changes.
@@ -231,9 +230,16 @@ if err != nil {
231230
client := cl.GetClient()
232231
```
233232

234-
Due to the BYO `request` type, controllers need to be built like this:
233+
Due to the BYO `request` type, controllers need to be built/changed like this:
235234

236235
```golang
236+
// previous
237+
builder.TypedControllerManagedBy[reconcile.Request](mgr).
238+
Named("single-cluster-controller").
239+
For(&corev1.Pod{}).
240+
Complete(reconciler)
241+
242+
// new
237243
builder.TypedControllerManagedBy[ClusterRequest](mgr).
238244
Named("multi-cluster-controller").
239245
Watches(&corev1.Pod{}, &ClusterRequestEventHandler{}).

0 commit comments

Comments
 (0)