Skip to content

Conversation

@fernando-villalba
Copy link
Collaborator

Completely redesigns the API based on the latest design doc, moving from individual component CRDs to a single "MultigresCluster" source of truth supported by reusable templates and read-only child resources.

Key Changes:

  • MultigresCluster: Re-implemented as the Root CR. strictly ordered structs and added "templateDefaults" and "overrides" logic.
  • Templates: Added CoreTemplate, CellTemplate, and ShardTemplate types to support reusable configuration.
  • Shared Types: Created shared_types.go to centralize common structs (StatelessSpec, ComponentConfig, StorageSpec) and prevent circular deps.
  • TopoServer: Refactored toposerver_types.go to include EtcdSpec and GlobalTopoServerRef, acting as the authoritative source for topology config.
  • Shard: Moved MultiOrchSpec, PoolSpec, and ShardImages into shard_types.go to localize domain-specific logic.
  • Children: Updated Cell, TableGroup, and Shard to reflect their status as read-only, fully resolved child resources.

Refactoring & Cleanup:

  • Deleted obsolete component types: deploymenttemplate, etcd, multigateway, and multiorch.
  • Applied strict "definition-before-use" ordering and added ASCII headers to all API files for better readability.
  • Standardized naming conventions (e.g., using Spec over Config for managed resources).

Copy link
Member

@rytswd rytswd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks good, just a few suggestions added

Removes the `ComponentConfig` struct to prevent `CoreTemplate` from
referencing other templates and to simplify the API structure.

Changes:
- Replaces `ComponentConfig` with a specialized `MultiAdminConfig` in `MultigresCluster`, enforcing "Spec OR TemplateRef" validation.
- Updates `CoreTemplate` to use `StatelessSpec` directly for `MultiAdmin`, flattening the YAML structure (removing the `spec` nesting) and preventing recursive template references.
- Deletes the unused `ComponentConfig` from `common_types.go`.
…ate scope

Updates the `TopoServer` and `CoreTemplate` definitions to improve extensibility and strictness.

Changes:
- Updates `TopoServerSpec` (Child CR) to wrap its configuration under an `etcd` key. This creates a polymorphic structure that can be extended with other backends (e.g., `consul`) in the future without breaking changes.
- Updates `CoreTemplate` to use `TopoServerSpec` for `GlobalTopoServer` instead of the cluster-level spec. This:
  1. Prevents templates from referencing other templates (removing recursion risks).
  2. Restricts templates to defining "Managed" workloads only, excluding environment-specific `external` configurations.
- Consolidates the usage of `EtcdSpec` across both Parent and Child resources for consistent schema definitions.
Copy link
Member

@rytswd rytswd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fernando-villalba fernando-villalba merged commit 446a4fc into main Dec 16, 2025
@fernando-villalba fernando-villalba deleted the api-spec branch December 16, 2025 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants