Skip to content

Commit 9aff6ae

Browse files
docs: update API design to reflect polymorphic TopoServer and CoreTemplate changes
Updates the V1Alpha1 design document to match the recent API refactoring. Changes: - Updates `CoreTemplate` examples to remove the `spec` nesting for `multiadmin` and restrict `globalTopoServer` to managed-only configurations (removing `external` options from templates). - Updates `TopoServer` child CR examples to use the new structure, wrapping configuration under an `etcd` key to allow for future extensivility.
1 parent 631e64b commit 9aff6ae

File tree

1 file changed

+39
-41
lines changed

1 file changed

+39
-41
lines changed

plans/phase-1/api-design/multigres-operator-api-v1alpha1-design.md

Lines changed: 39 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ status:
389389
* This CR is NOT a child resource. It is purely a configuration object.
390390
* It is namespaced to support RBAC scoping (e.g., platform team owns templates, dev team owns clusters).
391391
* It defines the shape of the cluster's core control plane, which comprises Global Topo Server and MultiAdmin. A `CoreTemplate` can contain definitions for *both* components. When a component (e.g., `globalTopoServer`) references this template, the controller will extract the relevant section.
392+
* **Note:** To prevent recursive definitions, `CoreTemplate` fields are strictly defined inline and cannot reference other templates. `multiadmin` uses a flattened spec structure here, unlike the `MultigresCluster` parent which nests it under `spec`.
392393

393394
```yaml
394395
apiVersion: multigres.com/v1alpha1
@@ -397,9 +398,10 @@ metadata:
397398
name: "standard-core-ha"
398399
namespace: example
399400
spec:
400-
# Defines the Global TopoServer component
401+
# Defines the Global TopoServer component.
402+
# RESTRICTION: Templates only support Managed Etcd configurations.
403+
# External topology servers must be defined in the Cluster CR directly.
401404
globalTopoServer:
402-
# --- OPTION 1: Managed by Operator ---
403405
etcd:
404406
image: "quay.io/coreos/etcd:v3.5"
405407
replicas: 3
@@ -413,34 +415,28 @@ spec:
413415
limits:
414416
cpu: "1"
415417
memory: "2Gi"
416-
# --- ALTERNATIVE OPTION 2: External Etcd ---
417-
# external:
418-
# endpoints:
419-
# - "https://etcd-1.infra.local:2379"
420-
# caSecret: "etcd-ca-secret"
421-
# clientCertSecret: "etcd-client-cert-secret"
422418
423-
# Defines the MultiAdmin component
419+
# Defines the MultiAdmin component.
420+
# Note: The 'spec' nesting is removed here (Flattened) compared to the Cluster CR.
424421
multiadmin:
425-
spec:
426-
replicas: 2
427-
resources:
428-
requests:
429-
cpu: "200m"
430-
memory: "256Mi"
431-
limits:
432-
cpu: "500m"
433-
memory: "512Mi"
434-
# Affinity can be configured too by user if desired
435-
# affinity:
436-
# podAntiAffinity:
437-
# preferredDuringSchedulingIgnoredDuringExecution:
438-
# - weight: 100
439-
# podAffinityTerm:
440-
# labelSelector:
441-
# matchLabels:
442-
# app.kubernetes.io/component: multiadmin
443-
# topologyKey: "kubernetes.io/hostname"
422+
replicas: 2
423+
resources:
424+
requests:
425+
cpu: "200m"
426+
memory: "256Mi"
427+
limits:
428+
cpu: "500m"
429+
memory: "512Mi"
430+
# Affinity can be configured too by user if desired
431+
# affinity:
432+
# podAntiAffinity:
433+
# preferredDuringSchedulingIgnoredDuringExecution:
434+
# - weight: 100
435+
# podAffinityTerm:
436+
# labelSelector:
437+
# matchLabels:
438+
# app.kubernetes.io/component: multiadmin
439+
# topologyKey: "kubernetes.io/hostname"
444440
```
445441

446442
### User Managed CR: CellTemplate
@@ -612,6 +608,7 @@ These resources are created and reconciled by the `MultigresCluster` controller.
612608

613609
* Applies to both Global (owned by `MultigresCluster`) and Local (owned by `Cell`) topology servers.
614610
* This CR does *not* exist if a separate, `external` etcd definition is used in the parent (e.g. using etcd-operator to provision one).
611+
* Configurations are wrapped under their implementation key (e.g., `etcd`) to allow future extensibility (e.g., `consul`).
615612

616613
```yaml
617614
apiVersion: multigres.com/v1alpha1
@@ -625,19 +622,20 @@ metadata:
625622
name: "example-cluster"
626623
controller: true
627624
spec:
628-
# Resolved from MultigresCluster.
629-
replicas: 3
630-
storage:
631-
size: "10Gi"
632-
class: "standard-gp3"
633-
image: "quay.io/coreos/etcd:v3.5"
634-
resources:
635-
requests:
636-
cpu: "500m"
637-
memory: "1Gi"
638-
limits:
639-
cpu: "1"
640-
memory: "2Gi"
625+
# Configuration is wrapped to allow for future polymorphic types (e.g. Consul).
626+
etcd:
627+
replicas: 3
628+
storage:
629+
size: "10Gi"
630+
class: "standard-gp3"
631+
image: "quay.io/coreos/etcd:v3.5"
632+
resources:
633+
requests:
634+
cpu: "500m"
635+
memory: "1Gi"
636+
limits:
637+
cpu: "1"
638+
memory: "2Gi"
641639
status:
642640
conditions:
643641
- type: Available

0 commit comments

Comments
 (0)