Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions api/v1alpha1/cell_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ type CellSpec struct {

// TopoServer defines the local topology config.
// +optional
TopoServer LocalTopoServerSpec `json:"topoServer,omitempty"`
TopoServer *LocalTopoServerSpec `json:"topoServer,omitempty"`

// AllCells list for discovery.
// +optional
// +kubebuilder:validation:MaxItems=100
// +kubebuilder:validation:MaxItems=50
AllCells []CellName `json:"allCells,omitempty"`

// TopologyReconciliation flags.
Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha1/common_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ type StatelessSpec struct {

// PodAnnotations are annotations to add to the pods.
// +optional
// +kubebuilder:validation:MaxProperties=64
// +kubebuilder:validation:MaxProperties=20
// +kubebuilder:validation:XValidation:rule="self.all(k, size(k) < 64 && size(self[k]) < 256)",message="annotation keys must be <64 chars and values <256 chars"
PodAnnotations map[string]string `json:"podAnnotations,omitempty"`

// PodLabels are additional labels to add to the pods.
// +optional
// +kubebuilder:validation:MaxProperties=64
// +kubebuilder:validation:MaxProperties=20
// +kubebuilder:validation:XValidation:rule="self.all(k, size(k) < 64 && size(self[k]) < 64)",message="label keys and values must be <64 chars"
PodLabels map[string]string `json:"podLabels,omitempty"`
}
Expand Down
16 changes: 8 additions & 8 deletions api/v1alpha1/multigrescluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ type MultigresClusterSpec struct {
// +optional
// +listType=map
// +listMapKey=name
// +kubebuilder:validation:MaxItems=100
// +kubebuilder:validation:MaxItems=50
Cells []CellConfig `json:"cells,omitempty"`

// Databases defines the logical databases, table groups, and sharding.
// +optional
// +listType=map
// +listMapKey=name
// +kubebuilder:validation:XValidation:rule="self.filter(x, has(x.default) && x.default).size() <= 1",message="only one database can be marked as default"
// +kubebuilder:validation:MaxItems=500
// +kubebuilder:validation:MaxItems=50
Databases []DatabaseConfig `json:"databases,omitempty"`
}

Expand Down Expand Up @@ -218,7 +218,7 @@ type DatabaseConfig struct {
// +listType=map
// +listMapKey=name
// +kubebuilder:validation:XValidation:rule="self.filter(x, has(x.default) && x.default).size() <= 1",message="only one tablegroup can be marked as default"
// +kubebuilder:validation:MaxItems=100
// +kubebuilder:validation:MaxItems=20
TableGroups []TableGroupConfig `json:"tablegroups,omitempty"`
}

Expand All @@ -237,7 +237,7 @@ type TableGroupConfig struct {
// +optional
// +listType=map
// +listMapKey=name
// +kubebuilder:validation:MaxItems=128
// +kubebuilder:validation:MaxItems=32
Shards []ShardConfig `json:"shards,omitempty"`
}

Expand Down Expand Up @@ -272,7 +272,7 @@ type ShardOverrides struct {

// Pools overrides. Keyed by pool name.
// +optional
// +kubebuilder:validation:MaxProperties=32
// +kubebuilder:validation:MaxProperties=8
Copy link
Member

Choose a reason for hiding this comment

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

Just curious, where is this number coming from?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

From my desperation and frugality to keep everything under CEL budget 😭

Don't take any of these limits as gospel, my guess is that we will need to adjust them further as we go along.

// +kubebuilder:validation:XValidation:rule="self.all(key, size(key) < 63)",message="pool names must be < 63 chars"
Pools map[string]PoolSpec `json:"pools,omitempty"`
}
Expand All @@ -285,7 +285,7 @@ type ShardInlineSpec struct {

// Pools configuration. Keyed by pool name.
// +optional
// +kubebuilder:validation:MaxProperties=32
// +kubebuilder:validation:MaxProperties=8
// +kubebuilder:validation:XValidation:rule="self.all(key, size(key) < 63)",message="pool names must be < 63 chars"
Pools map[string]PoolSpec `json:"pools,omitempty"`
}
Expand All @@ -305,13 +305,13 @@ type MultigresClusterStatus struct {
Conditions []metav1.Condition `json:"conditions,omitempty"`
// Cells status summary.
// +optional
// +kubebuilder:validation:MaxProperties=100
// +kubebuilder:validation:MaxProperties=50
// +kubebuilder:validation:XValidation:rule="self.all(key, size(key) < 63)",message="cell names must be < 63 chars"
Cells map[string]CellStatusSummary `json:"cells,omitempty"`

// Databases status summary.
// +optional
// +kubebuilder:validation:MaxProperties=500
// +kubebuilder:validation:MaxProperties=50
// +kubebuilder:validation:XValidation:rule="self.all(key, size(key) < 63)",message="database names must be < 63 chars"
Databases map[string]DatabaseStatusSummary `json:"databases,omitempty"`
}
Expand Down
8 changes: 4 additions & 4 deletions api/v1alpha1/shard_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type MultiOrchSpec struct {
// Cells defines the list of cells where this MultiOrch should be deployed.
// If empty, it defaults to all cells where pools are defined.
// +optional
// +kubebuilder:validation:MaxItems=100
// +kubebuilder:validation:MaxItems=50
Cells []CellName `json:"cells,omitempty"`
}

Expand All @@ -49,7 +49,7 @@ type PoolSpec struct {

// Cells defines the list of cells where this Pool should be deployed.
// +optional
// +kubebuilder:validation:MaxItems=100
// +kubebuilder:validation:MaxItems=50
Cells []CellName `json:"cells,omitempty"`

// ReplicasPerCell is the desired number of pods PER CELL in this pool.
Expand Down Expand Up @@ -105,7 +105,7 @@ type ShardSpec struct {
MultiOrch MultiOrchSpec `json:"multiorch"`

// Pools is the map of fully resolved data pool configurations.
// +kubebuilder:validation:MaxProperties=32
// +kubebuilder:validation:MaxProperties=8
// +kubebuilder:validation:XValidation:rule="self.all(key, size(key) < 63)",message="pool names must be < 63 chars"
Pools map[string]PoolSpec `json:"pools"`
}
Expand Down Expand Up @@ -137,7 +137,7 @@ type ShardStatus struct {

// Cells is a list of cells this shard is currently deployed to.
// +optional
// +kubebuilder:validation:MaxItems=100
// +kubebuilder:validation:MaxItems=50
Cells []CellName `json:"cells,omitempty"`

// OrchReady indicates if the MultiOrch component is ready.
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/shardtemplate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type ShardTemplateSpec struct {
MultiOrch *MultiOrchSpec `json:"multiorch,omitempty"`

// +optional
// +kubebuilder:validation:MaxProperties=32
// +kubebuilder:validation:MaxProperties=8
// +kubebuilder:validation:XValidation:rule="self.all(key, size(key) < 63)",message="pool names must be < 63 chars"
Pools map[string]PoolSpec `json:"pools,omitempty"`
}
Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha1/tablegroup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ type TableGroupSpec struct {
GlobalTopoServer GlobalTopoServerRef `json:"globalTopoServer"`

// Shards is the list of FULLY RESOLVED shard specifications.
// +kubebuilder:validation:MaxItems=128
// +kubebuilder:validation:MaxItems=32
Shards []ShardResolvedSpec `json:"shards"`
}

Expand All @@ -63,7 +63,7 @@ type ShardResolvedSpec struct {
MultiOrch MultiOrchSpec `json:"multiorch"`

// Pools is the map of fully resolved data pool configurations.
// +kubebuilder:validation:MaxProperties=32
// +kubebuilder:validation:MaxProperties=8
// +kubebuilder:validation:XValidation:rule="self.all(key, size(key) < 63)",message="pool names must be < 63 chars"
Pools map[string]PoolSpec `json:"pools"`
}
Expand Down
6 changes: 5 additions & 1 deletion api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 15 additions & 3 deletions config/crd/bases/multigres.com_cells.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,24 @@ spec:
maxLength: 63
minLength: 1
type: string
maxItems: 100
maxItems: 50
type: array
globalTopoServer:
description: GlobalTopoServer reference (always populated).
properties:
address:
description: Address is the DNS address of the topology server.
maxLength: 512
minLength: 1
type: string
implementation:
description: Implementation defines the client implementation
(e.g. "etcd").
maxLength: 63
minLength: 1
type: string
rootPath:
description: RootPath is the etcd prefix for this cluster.
maxLength: 512
minLength: 1
type: string
Expand Down Expand Up @@ -1002,7 +1006,7 @@ spec:
additionalProperties:
type: string
description: PodAnnotations are annotations to add to the pods.
maxProperties: 64
maxProperties: 48
type: object
x-kubernetes-validations:
- message: annotation keys must be <64 chars and values <256 chars
Expand All @@ -1011,7 +1015,7 @@ spec:
additionalProperties:
type: string
description: PodLabels are additional labels to add to the pods.
maxProperties: 64
maxProperties: 48
type: object
x-kubernetes-validations:
- message: label keys and values must be <64 chars
Expand Down Expand Up @@ -1225,8 +1229,12 @@ spec:
description: TopologyReconciliation flags.
properties:
prunePoolers:
description: PrunePoolers indicates if unused poolers should be
removed.
type: boolean
registerCell:
description: RegisterCell indicates if the cell should register
itself in the topology.
type: boolean
required:
- prunePoolers
Expand Down Expand Up @@ -1306,12 +1314,16 @@ spec:
type: object
type: array
gatewayReadyReplicas:
description: GatewayReadyReplicas is the number of gateway pods that
are ready.
format: int32
type: integer
gatewayReplicas:
description: GatewayReplicas is the total number of gateway pods.
format: int32
type: integer
gatewayServiceName:
description: GatewayServiceName is the DNS name of the gateway service.
maxLength: 253
type: string
required:
Expand Down
4 changes: 2 additions & 2 deletions config/crd/bases/multigres.com_celltemplates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,7 @@ spec:
additionalProperties:
type: string
description: PodAnnotations are annotations to add to the pods.
maxProperties: 64
maxProperties: 48
type: object
x-kubernetes-validations:
- message: annotation keys must be <64 chars and values <256 chars
Expand All @@ -1102,7 +1102,7 @@ spec:
additionalProperties:
type: string
description: PodLabels are additional labels to add to the pods.
maxProperties: 64
maxProperties: 48
type: object
x-kubernetes-validations:
- message: label keys and values must be <64 chars
Expand Down
4 changes: 2 additions & 2 deletions config/crd/bases/multigres.com_coretemplates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,7 @@ spec:
additionalProperties:
type: string
description: PodAnnotations are annotations to add to the pods.
maxProperties: 64
maxProperties: 48
type: object
x-kubernetes-validations:
- message: annotation keys must be <64 chars and values <256 chars
Expand All @@ -1071,7 +1071,7 @@ spec:
additionalProperties:
type: string
description: PodLabels are additional labels to add to the pods.
maxProperties: 64
maxProperties: 48
type: object
x-kubernetes-validations:
- message: label keys and values must be <64 chars
Expand Down
Loading