Skip to content

Commit 5b96bd5

Browse files
Merge pull request #79 from numtide/design-doc-change
docs: update API design to reflect TopoServer and CoreTemplate changes
2 parents 446a4fc + 2c8e5c8 commit 5b96bd5

File tree

1 file changed

+38
-41
lines changed

1 file changed

+38
-41
lines changed

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

Lines changed: 38 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,27 @@ 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.
424420
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"
421+
replicas: 2
422+
resources:
423+
requests:
424+
cpu: "200m"
425+
memory: "256Mi"
426+
limits:
427+
cpu: "500m"
428+
memory: "512Mi"
429+
# Affinity can be configured too by user if desired
430+
# affinity:
431+
# podAntiAffinity:
432+
# preferredDuringSchedulingIgnoredDuringExecution:
433+
# - weight: 100
434+
# podAffinityTerm:
435+
# labelSelector:
436+
# matchLabels:
437+
# app.kubernetes.io/component: multiadmin
438+
# topologyKey: "kubernetes.io/hostname"
444439
```
445440

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

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

616612
```yaml
617613
apiVersion: multigres.com/v1alpha1
@@ -625,19 +621,20 @@ metadata:
625621
name: "example-cluster"
626622
controller: true
627623
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"
624+
# Configuration is wrapped to allow for future polymorphic types (e.g. Consul).
625+
etcd:
626+
replicas: 3
627+
storage:
628+
size: "10Gi"
629+
class: "standard-gp3"
630+
image: "quay.io/coreos/etcd:v3.5"
631+
resources:
632+
requests:
633+
cpu: "500m"
634+
memory: "1Gi"
635+
limits:
636+
cpu: "1"
637+
memory: "2Gi"
641638
status:
642639
conditions:
643640
- type: Available

0 commit comments

Comments
 (0)