v1alpha1

package
v0.10.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package v1alpha1 defines the API types for the Multigres Operator.

This package contains the Go type definitions for all Custom Resources in the multigres.com API group. These types are used by kubebuilder to generate:

  • CustomResourceDefinitions (CRDs)
  • DeepCopy methods
  • Client code

Custom Resources

The API defines a hierarchical structure of resources:

User-Facing Resources:

  • MultigresCluster: The root resource representing a complete distributed database cluster. Users define cells, databases, and configuration here.
  • CoreTemplate: Reusable configuration template for core components (MultiAdmin).
  • CellTemplate: Reusable configuration template for cell components (MultiGateway).
  • ShardTemplate: Reusable configuration template for shards (pools, orchestrator).

Operator-Managed Resources (child resources created by the operator):

  • Cell: Represents a failure domain with its own MultiGateway deployment.
  • TableGroup: Groups shards belonging to the same database table group.
  • Shard: A database shard with PostgreSQL pools and orchestrator.
  • TopoServer: Etcd-based topology storage server.

Resource Hierarchy

MultigresCluster
├── TopoServer (global topology)
├── Cell (per failure domain)
│   └── MultiGateway Deployment
└── TableGroup (per database.tablegroup)
    └── Shard (per shard)
        ├── Pool StatefulSets (PostgreSQL replicas)
        └── MultiOrch Deployment

Versioning

This is the v1alpha1 version, indicating the API is in early development and may change in backward-incompatible ways.

Package v1alpha1 contains API Schema definitions for the multigres v1alpha1 API group. +kubebuilder:object:generate=true +groupName=multigres.com

Index

Constants

View Source
const (
	// AnnotationPendingDeletion is set by the TableGroup controller on a Shard
	// that should be gracefully drained before deletion. The shard controller
	// drains all pods and sets ConditionReadyForDeletion when complete.
	AnnotationPendingDeletion = "multigres.com/pending-deletion"

	// FinalizerClusterCleanup is the finalizer added to MultigresCluster
	// resources to ensure the controller can coordinate graceful child
	// teardown (PendingDeletion → ReadyForDeletion → Delete) before the
	// parent is removed from the API server.
	FinalizerClusterCleanup = "multigres.com/cluster-cleanup"

	// ConditionReadyForDeletion is set to True on a Shard once all pods have
	// been drained. The TableGroup controller waits for this condition before
	// calling Delete on the Shard CR.
	ConditionReadyForDeletion = "ReadyForDeletion"

	// ConditionDeletionBlocked is set on a parent resource when a child with
	// PendingDeletion has not set ReadyForDeletion within the escalation
	// timeout. The parent emits a Warning event but does not force-delete;
	// operator intervention is required.
	ConditionDeletionBlocked = "DeletionBlocked"

	// ConditionTerminalError is set when a controller encounters a permanent
	// failure (invalid config, auth failure). The condition includes a config
	// hash so the controller can detect when the user changes the configuration.
	ConditionTerminalError = "TerminalError"
)
View Source
const (
	// DefaultPostgresImage is the default container image for PostgreSQL instances.
	// Uses the pgctld image which bundles PostgreSQL, pgctld, and pgbackrest.
	DefaultPostgresImage = "ghcr.io/multigres/pgctld:sha-cbc77e3"

	// DefaultEtcdImage is the default container image for the managed Etcd cluster.
	DefaultEtcdImage = "gcr.io/etcd-development/etcd:v3.6.7"

	// DefaultMultiAdminImage is the default container image for the MultiAdmin component.
	DefaultMultiAdminImage = "ghcr.io/multigres/multigres:sha-cbc77e3"

	// DefaultMultiAdminWebImage is the default container image for the MultiAdminWeb component.
	DefaultMultiAdminWebImage = "ghcr.io/multigres/multiadmin-web:sha-d7be6e4"

	// DefaultMultiOrchImage is the default container image for the MultiOrch component.
	DefaultMultiOrchImage = "ghcr.io/multigres/multigres:sha-cbc77e3"

	// DefaultMultiPoolerImage is the default container image for the MultiPooler component.
	DefaultMultiPoolerImage = "ghcr.io/multigres/multigres:sha-cbc77e3"

	// DefaultMultiGatewayImage is the default container image for the MultiGateway component.
	DefaultMultiGatewayImage = "ghcr.io/multigres/multigres:sha-cbc77e3"
)

NOTE: The Makefile extracts image references from this file (lines matching = "...") to pre-load them into the kind cluster.

View Source
const (
	// ConditionGatewayExternalReady indicates whether the external endpoint
	// is provisioned and backed by ready gateway pods.
	ConditionGatewayExternalReady = "GatewayExternalReady"

	// ReasonAwaitingEndpoint indicates the service endpoint has not
	// yet been provisioned.
	ReasonAwaitingEndpoint = "AwaitingEndpoint"

	// ReasonNoReadyGateways indicates the external endpoint is assigned but
	// no multigateway pods are ready.
	ReasonNoReadyGateways = "NoReadyGateways"

	// ReasonEndpointReady indicates the external endpoint is serving traffic.
	ReasonEndpointReady = "EndpointReady"
)
View Source
const (
	// ConditionAdminWebExternalReady indicates whether the external endpoint
	// is provisioned and backed by ready multiadmin-web pods.
	ConditionAdminWebExternalReady = "AdminWebExternalReady"

	// ReasonNoReadyAdminWeb indicates the external endpoint is assigned but
	// no multiadmin-web pods are ready.
	ReasonNoReadyAdminWeb = "NoReadyAdminWeb"
)
View Source
const (
	// OTELSamplingVolumeName is the volume name for the sampling config ConfigMap.
	OTELSamplingVolumeName = "otel-sampling-config"

	// OTELSamplingMountPath is where the sampling config ConfigMap is mounted.
	OTELSamplingMountPath = "/etc/otel"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects.
	GroupVersion = schema.GroupVersion{Group: "multigres.com", Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func BuildOTELEnvVars

func BuildOTELEnvVars(cfg *ObservabilityConfig) []corev1.EnvVar

BuildOTELEnvVars converts an ObservabilityConfig into a slice of environment variables suitable for injection into data-plane containers.

Fallback behaviour: when cfg is nil or a field is empty, the operator's own environment variable (if set) is used as the default. This means data-plane pods automatically inherit the operator's telemetry endpoint unless explicitly overridden or disabled.

Setting cfg.OTLPEndpoint to "disabled" suppresses all OTEL variables, returning nil regardless of other field values.

func BuildOTELSamplingVolume

func BuildOTELSamplingVolume(cfg *ObservabilityConfig) (*corev1.Volume, *corev1.VolumeMount)

BuildOTELSamplingVolume returns a Volume and VolumeMount for the sampling config ConfigMap. Returns nils if cfg is nil or SamplingConfigRef is not set.

Types

type AdminWebStatus

type AdminWebStatus struct {
	// ExternalEndpoint is the hostname or IP for the external admin web endpoint,
	// sourced from externalIPs or load balancer ingress (in that priority).
	// Empty when no external endpoint has been provisioned.
	ExternalEndpoint string `json:"externalEndpoint"`
}

AdminWebStatus reports the external admin web state.

func (*AdminWebStatus) DeepCopy

func (in *AdminWebStatus) DeepCopy() *AdminWebStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdminWebStatus.

func (*AdminWebStatus) DeepCopyInto

func (in *AdminWebStatus) DeepCopyInto(out *AdminWebStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BackupConfig

type BackupConfig struct {
	// Type is the backup storage backend (filesystem or s3).
	Type BackupType `json:"type"`

	// Filesystem defines configuration for local/PVC-based backups.
	// Required when type is "filesystem".
	// +optional
	Filesystem *FilesystemBackupConfig `json:"filesystem,omitempty"`

	// S3 defines the S3-compatible storage configuration.
	// Required when type is "s3".
	// +optional
	S3 *S3BackupConfig `json:"s3,omitempty"`

	// PgBackRestTLS configures TLS certificates for pgBackRest inter-node communication.
	// Required for multi-replica shards where standbys connect to the primary's
	// pgBackRest server. When SecretName is set, the operator mounts that Secret directly.
	// When SecretName is empty, the operator auto-generates and rotates certificates.
	// +optional
	PgBackRestTLS *PgBackRestTLSConfig `json:"pgbackrestTLS,omitempty"`
}

BackupConfig defines the pgBackRest backup configuration. +kubebuilder:validation:XValidation:rule="self.type != 's3' || has(self.s3)",message="s3 config is required when type is 's3'" +kubebuilder:validation:XValidation:rule="self.type != 'filesystem' || has(self.filesystem)",message="filesystem config is required when type is 'filesystem'"

func MergeBackupConfig

func MergeBackupConfig(child, parent *BackupConfig) *BackupConfig

MergeBackupConfig merges child and parent backup config with child taking precedence. Implements deep merge logic where appropriate.

func (*BackupConfig) DeepCopy

func (in *BackupConfig) DeepCopy() *BackupConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupConfig.

func (*BackupConfig) DeepCopyInto

func (in *BackupConfig) DeepCopyInto(out *BackupConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BackupType

type BackupType string

BackupType defines the backup storage backend. +kubebuilder:validation:Enum=filesystem;s3

const (
	// BackupTypeFilesystem uses a local PVC for pgBackRest backup storage.
	BackupTypeFilesystem BackupType = "filesystem"
	// BackupTypeS3 uses S3-compatible object storage for pgBackRest backup storage.
	BackupTypeS3 BackupType = "s3"
)

type Cell

type Cell struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   CellSpec   `json:"spec,omitempty"`
	Status CellStatus `json:"status,omitempty"`
}

Cell represents a failure-domain unit within a MultigresCluster (typically one per availability zone). +kubebuilder:resource:shortName=cel +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase"

func (*Cell) DeepCopy

func (in *Cell) DeepCopy() *Cell

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cell.

func (*Cell) DeepCopyInto

func (in *Cell) DeepCopyInto(out *Cell)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Cell) DeepCopyObject

func (in *Cell) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type CellConfig

type CellConfig struct {
	// Name is the logical name of the cell.
	Name CellName `json:"name"`

	// Zone indicates the physical availability zone.
	// +optional
	Zone Zone `json:"zone,omitempty"`
	// Region indicates the physical region (mutually exclusive with zone via CEL validation).
	// +optional
	Region Region `json:"region,omitempty"`

	// CellTemplate refers to a CellTemplate CR.
	// +optional
	CellTemplate TemplateRef `json:"cellTemplate,omitempty"`

	// Overrides are applied on top of the template.
	// +optional
	Overrides *CellOverrides `json:"overrides,omitempty"`

	// Spec defines the inline configuration if no template is used.
	// +optional
	Spec *CellInlineSpec `json:"spec,omitempty"`
}

CellConfig defines a cell in the cluster. +kubebuilder:validation:XValidation:rule="!(has(self.spec) && has(self.cellTemplate))",message="cannot specify both 'spec' and 'cellTemplate'" +kubebuilder:validation:XValidation:rule="!(has(self.spec) && has(self.overrides))",message="cannot specify both 'spec' and 'overrides'" +kubebuilder:validation:XValidation:rule="!(has(self.zone) && has(self.region))",message="cannot specify both 'zone' and 'region'"

func (*CellConfig) DeepCopy

func (in *CellConfig) DeepCopy() *CellConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CellConfig.

func (*CellConfig) DeepCopyInto

func (in *CellConfig) DeepCopyInto(out *CellConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CellImages

type CellImages struct {
	// ImagePullPolicy overrides the default image pull policy.
	// +optional
	// +kubebuilder:validation:Enum=Always;Never;IfNotPresent
	ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`

	// ImagePullSecrets is a list of references to secrets in the same namespace.
	// +optional
	ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`

	// MultiGateway is the image used for the gateway.
	MultiGateway ImageRef `json:"multigateway"`
}

CellImages defines the images required for a Cell.

func (*CellImages) DeepCopy

func (in *CellImages) DeepCopy() *CellImages

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CellImages.

func (*CellImages) DeepCopyInto

func (in *CellImages) DeepCopyInto(out *CellImages)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CellInlineSpec

type CellInlineSpec struct {
	// MultiGateway configuration.
	// +optional
	MultiGateway StatelessSpec `json:"multigateway,omitempty"`

	// MultiGatewayPlacement defines optional scheduling settings for multigateway pods.
	// +optional
	MultiGatewayPlacement *PodPlacementSpec `json:"multigatewayPlacement,omitempty"`

	// LocalTopoServer configuration (optional).
	// +optional
	LocalTopoServer *LocalTopoServerSpec `json:"localTopoServer,omitempty"`
}

CellInlineSpec defines the inline configuration for a Cell. +kubebuilder:validation:XValidation:rule="!has(self.localTopoServer)",message="local topology servers (localTopoServer) are not yet supported"

func (*CellInlineSpec) DeepCopy

func (in *CellInlineSpec) DeepCopy() *CellInlineSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CellInlineSpec.

func (*CellInlineSpec) DeepCopyInto

func (in *CellInlineSpec) DeepCopyInto(out *CellInlineSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CellList

type CellList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Cell `json:"items"`
}

CellList contains a list of Cell

func (*CellList) DeepCopy

func (in *CellList) DeepCopy() *CellList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CellList.

func (*CellList) DeepCopyInto

func (in *CellList) DeepCopyInto(out *CellList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*CellList) DeepCopyObject

func (in *CellList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type CellName

type CellName string

CellName is a validated name for a cell (availability zone unit) within a cluster. +kubebuilder:validation:MinLength=1 +kubebuilder:validation:MaxLength=30 +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`

type CellOverrides

type CellOverrides struct {
	// MultiGateway overrides.
	// +optional
	MultiGateway *StatelessSpec `json:"multigateway,omitempty"`

	// MultiGatewayPlacement overrides.
	// +optional
	MultiGatewayPlacement *PodPlacementSpec `json:"multigatewayPlacement,omitempty"`
}

CellOverrides defines overrides for a CellTemplate.

func (*CellOverrides) DeepCopy

func (in *CellOverrides) DeepCopy() *CellOverrides

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CellOverrides.

func (*CellOverrides) DeepCopyInto

func (in *CellOverrides) DeepCopyInto(out *CellOverrides)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CellSpec

type CellSpec struct {
	// Name is the logical name of the cell.
	Name CellName `json:"name"`
	// Zone indicates the physical availability zone.
	Zone Zone `json:"zone,omitempty"`
	// Region indicates the physical region.
	// +optional
	Region Region `json:"region,omitempty"`

	// Images defines the container images used in this cell.
	Images CellImages `json:"images"`

	// MultiGateway fully resolved config.
	MultiGateway StatelessSpec `json:"multigateway"`

	// MultiGatewayPlacement defines optional scheduling settings for multigateway pods.
	// +optional
	MultiGatewayPlacement *PodPlacementSpec `json:"multigatewayPlacement,omitempty"`

	// GlobalTopoServer reference (always populated).
	GlobalTopoServer GlobalTopoServerRef `json:"globalTopoServer"`

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

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

	// TopologyReconciliation flags.
	// +optional
	TopologyReconciliation TopologyReconciliation `json:"topologyReconciliation,omitempty"`

	// Observability configures OpenTelemetry for cell-level data-plane components.
	// Inherited from MultigresCluster.Spec.Observability by the resolver.
	// +optional
	Observability *ObservabilityConfig `json:"observability,omitempty"`

	// LogLevels is the resolved log level configuration for cell-level components.
	// Inherited from MultigresCluster.Spec.LogLevels.
	// +optional
	LogLevels ComponentLogLevels `json:"logLevels,omitempty"`
}

CellSpec defines the desired state of Cell. +kubebuilder:validation:XValidation:rule="!(has(self.zone) && has(self.region))",message="cannot specify both 'zone' and 'region'"

func (*CellSpec) DeepCopy

func (in *CellSpec) DeepCopy() *CellSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CellSpec.

func (*CellSpec) DeepCopyInto

func (in *CellSpec) DeepCopyInto(out *CellSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CellStatus

type CellStatus struct {
	// ObservedGeneration is the most recent generation observed.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// Conditions represent the latest available observations.
	// +optional
	// +listType=map
	// +listMapKey=type
	Conditions []metav1.Condition `json:"conditions,omitempty"`

	// Phase represents the aggregated lifecycle state of the cell.
	// +optional
	Phase Phase `json:"phase,omitempty"`

	// Message provides details about the current phase.
	// +optional
	Message string `json:"message,omitempty"`

	// GatewayReplicas is the total number of gateway pods.
	GatewayReplicas int32 `json:"gatewayReplicas"`

	// GatewayReadyReplicas is the number of gateway pods that are ready.
	GatewayReadyReplicas int32 `json:"gatewayReadyReplicas"`

	// GatewayServiceName is the DNS name of the gateway service.
	// +kubebuilder:validation:MaxLength=253
	GatewayServiceName string `json:"gatewayServiceName,omitempty"`
}

CellStatus defines the observed state of Cell.

func (*CellStatus) DeepCopy

func (in *CellStatus) DeepCopy() *CellStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CellStatus.

func (*CellStatus) DeepCopyInto

func (in *CellStatus) DeepCopyInto(out *CellStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CellStatusSummary

type CellStatusSummary struct {
	Ready           bool  `json:"ready"`
	GatewayReplicas int32 `json:"gatewayReplicas"`
}

CellStatusSummary provides a high-level status of a cell.

func (*CellStatusSummary) DeepCopy

func (in *CellStatusSummary) DeepCopy() *CellStatusSummary

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CellStatusSummary.

func (*CellStatusSummary) DeepCopyInto

func (in *CellStatusSummary) DeepCopyInto(out *CellStatusSummary)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CellTemplate

type CellTemplate struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec CellTemplateSpec `json:"spec,omitempty"`
}

CellTemplate provides reusable cell-level configuration (images, resources) for MultigresCluster cells. +kubebuilder:resource:shortName=cet

func (*CellTemplate) DeepCopy

func (in *CellTemplate) DeepCopy() *CellTemplate

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CellTemplate.

func (*CellTemplate) DeepCopyInto

func (in *CellTemplate) DeepCopyInto(out *CellTemplate)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*CellTemplate) DeepCopyObject

func (in *CellTemplate) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type CellTemplateList

type CellTemplateList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []CellTemplate `json:"items"`
}

CellTemplateList contains a list of CellTemplate

func (*CellTemplateList) DeepCopy

func (in *CellTemplateList) DeepCopy() *CellTemplateList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CellTemplateList.

func (*CellTemplateList) DeepCopyInto

func (in *CellTemplateList) DeepCopyInto(out *CellTemplateList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*CellTemplateList) DeepCopyObject

func (in *CellTemplateList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type CellTemplateSpec

type CellTemplateSpec struct {
	// MultiGateway configuration.
	// +optional
	MultiGateway *StatelessSpec `json:"multigateway,omitempty"`

	// MultiGatewayPlacement defines optional scheduling settings for multigateway pods.
	// +optional
	MultiGatewayPlacement *PodPlacementSpec `json:"multigatewayPlacement,omitempty"`

	// LocalTopoServer configuration (optional).
	// +optional
	LocalTopoServer *LocalTopoServerSpec `json:"localTopoServer,omitempty"`
}

CellTemplateSpec defines reusable config for Cell components (Gateway, LocalTopo). +kubebuilder:validation:XValidation:rule="!has(self.localTopoServer)",message="local topology servers (localTopoServer) are not yet supported"

func (*CellTemplateSpec) DeepCopy

func (in *CellTemplateSpec) DeepCopy() *CellTemplateSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CellTemplateSpec.

func (*CellTemplateSpec) DeepCopyInto

func (in *CellTemplateSpec) DeepCopyInto(out *CellTemplateSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ClusterImages

type ClusterImages struct {
	// ImagePullPolicy overrides the default image pull policy.
	// +optional
	// +kubebuilder:validation:Enum=Always;Never;IfNotPresent
	ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`

	// ImagePullSecrets is a list of references to secrets in the same namespace.
	// +optional
	ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`

	// Component Images
	// +optional
	MultiGateway ImageRef `json:"multigateway,omitempty"`
	// +optional
	MultiOrch ImageRef `json:"multiorch,omitempty"`
	// +optional
	MultiPooler ImageRef `json:"multipooler,omitempty"`
	// +optional
	MultiAdmin ImageRef `json:"multiadmin,omitempty"`
	// +optional
	MultiAdminWeb ImageRef `json:"multiadminWeb,omitempty"`
	// +optional
	Postgres ImageRef `json:"postgres,omitempty"`
}

ClusterImages defines the container images for all components in the cluster.

func (*ClusterImages) DeepCopy

func (in *ClusterImages) DeepCopy() *ClusterImages

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterImages.

func (*ClusterImages) DeepCopyInto

func (in *ClusterImages) DeepCopyInto(out *ClusterImages)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ComponentLogLevels

type ComponentLogLevels struct {
	// +optional
	Pgctld LogLevel `json:"pgctld,omitempty"`
	// +optional
	Multipooler LogLevel `json:"multipooler,omitempty"`
	// +optional
	Multiorch LogLevel `json:"multiorch,omitempty"`
	// +optional
	Multiadmin LogLevel `json:"multiadmin,omitempty"`
	// +optional
	Multigateway LogLevel `json:"multigateway,omitempty"`
}

ComponentLogLevels configures the --log-level flag for each multigres data-plane component. All fields are optional; unset fields default to "info" via the admission webhook.

func (*ComponentLogLevels) DeepCopy

func (in *ComponentLogLevels) DeepCopy() *ComponentLogLevels

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComponentLogLevels.

func (*ComponentLogLevels) DeepCopyInto

func (in *ComponentLogLevels) DeepCopyInto(out *ComponentLogLevels)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ContainerConfig

type ContainerConfig struct {
	// Resources defines the compute resource requirements.
	// +optional
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`
}

ContainerConfig defines generic container configuration.

func (*ContainerConfig) DeepCopy

func (in *ContainerConfig) DeepCopy() *ContainerConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerConfig.

func (*ContainerConfig) DeepCopyInto

func (in *ContainerConfig) DeepCopyInto(out *ContainerConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CoreTemplate

type CoreTemplate struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec CoreTemplateSpec `json:"spec,omitempty"`
}

CoreTemplate provides reusable infrastructure configuration (pod resources, scheduling) for cluster core components. +kubebuilder:resource:shortName=cot

func (*CoreTemplate) DeepCopy

func (in *CoreTemplate) DeepCopy() *CoreTemplate

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CoreTemplate.

func (*CoreTemplate) DeepCopyInto

func (in *CoreTemplate) DeepCopyInto(out *CoreTemplate)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*CoreTemplate) DeepCopyObject

func (in *CoreTemplate) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type CoreTemplateList

type CoreTemplateList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []CoreTemplate `json:"items"`
}

CoreTemplateList contains a list of CoreTemplate

func (*CoreTemplateList) DeepCopy

func (in *CoreTemplateList) DeepCopy() *CoreTemplateList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CoreTemplateList.

func (*CoreTemplateList) DeepCopyInto

func (in *CoreTemplateList) DeepCopyInto(out *CoreTemplateList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*CoreTemplateList) DeepCopyObject

func (in *CoreTemplateList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type CoreTemplateSpec

type CoreTemplateSpec struct {
	// GlobalTopoServer configuration.
	// Uses TopoServerSpec directly (Managed Etcd only).
	// +optional
	GlobalTopoServer *TopoServerSpec `json:"globalTopoServer,omitempty"`

	// MultiAdmin configuration.
	// +optional
	MultiAdmin *StatelessSpec `json:"multiadmin,omitempty"`

	// MultiAdminWeb configuration.
	// +optional
	MultiAdminWeb *StatelessSpec `json:"multiadminWeb,omitempty"`
}

CoreTemplateSpec defines reusable config for core components (GlobalTopo, MultiAdmin).

func (*CoreTemplateSpec) DeepCopy

func (in *CoreTemplateSpec) DeepCopy() *CoreTemplateSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CoreTemplateSpec.

func (*CoreTemplateSpec) DeepCopyInto

func (in *CoreTemplateSpec) DeepCopyInto(out *CoreTemplateSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DatabaseConfig

type DatabaseConfig struct {
	// Name is the logical name of the database.
	Name DatabaseName `json:"name"`

	// Default indicates if this is the system default database.
	// +optional
	Default bool `json:"default,omitempty"`

	// TableGroups is a list of table groups.
	// +optional
	// +listType=map
	// +listMapKey=name
	// +kubebuilder:validation:XValidation:rule="self.filter(x, has(x.default) && x.default).size() == 1",message="every database must have exactly one tablegroup marked as default"
	// +kubebuilder:validation:MaxItems=20
	TableGroups []TableGroupConfig `json:"tablegroups,omitempty"`

	// Backup overrides the global backup configuration for this specific database.
	// +optional
	Backup *BackupConfig `json:"backup,omitempty"`

	// DurabilityPolicy overrides the cluster-level durability policy for this database.
	// See MultigresClusterSpec.DurabilityPolicy for supported values.
	// +optional
	DurabilityPolicy string `json:"durabilityPolicy,omitempty"`
}

DatabaseConfig defines a logical database.

func (*DatabaseConfig) DeepCopy

func (in *DatabaseConfig) DeepCopy() *DatabaseConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseConfig.

func (*DatabaseConfig) DeepCopyInto

func (in *DatabaseConfig) DeepCopyInto(out *DatabaseConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DatabaseName

type DatabaseName string

DatabaseName is a validated name for a logical database within a MultigresCluster. +kubebuilder:validation:MinLength=1 +kubebuilder:validation:MaxLength=30 +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`

type DatabaseStatusSummary

type DatabaseStatusSummary struct {
	ReadyShards int32 `json:"readyShards"`
	TotalShards int32 `json:"totalShards"`
}

DatabaseStatusSummary provides a high-level status of a database.

func (*DatabaseStatusSummary) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseStatusSummary.

func (*DatabaseStatusSummary) DeepCopyInto

func (in *DatabaseStatusSummary) DeepCopyInto(out *DatabaseStatusSummary)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type EndpointUrl

type EndpointUrl string

EndpointUrl is a string restricted to 2048 characters for strict validation budgeting. +kubebuilder:validation:MinLength=1 +kubebuilder:validation:MaxLength=2048

type EtcdSpec

type EtcdSpec struct {
	// Image is the Etcd container image.
	// +optional
	Image ImageRef `json:"image,omitempty"`

	// Replicas is the desired number of etcd members.
	// Immutable after cluster creation — etcd does not support dynamic member addition
	// with static bootstrap. Must be an odd number for proper quorum fault tolerance.
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:XValidation:rule="self % 2 == 1",message="etcd replicas must be an odd number (1, 3, 5); even numbers provide no additional fault tolerance over the next lower odd number"
	// +optional
	Replicas *int32 `json:"replicas,omitempty"`

	// Storage configuration for Etcd data.
	// +optional
	Storage StorageSpec `json:"storage,omitempty"`

	// Resources defines the compute resource requirements.
	// +optional
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`

	// RootPath is the etcd prefix for this cluster.
	// +optional
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=512
	RootPath string `json:"rootPath,omitempty"`

	// PVCDeletionPolicy controls PVC lifecycle for etcd volumes.
	// Overrides GlobalTopoServerSpec and MultigresCluster settings.
	// +optional
	PVCDeletionPolicy *PVCDeletionPolicy `json:"pvcDeletionPolicy,omitempty"`
}

EtcdSpec defines the configuration for a managed Etcd cluster.

func (*EtcdSpec) DeepCopy

func (in *EtcdSpec) DeepCopy() *EtcdSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EtcdSpec.

func (*EtcdSpec) DeepCopyInto

func (in *EtcdSpec) DeepCopyInto(out *EtcdSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ExternalAdminWebConfig

type ExternalAdminWebConfig struct {
	// Enabled controls whether external admin web exposure is enabled.
	// The global Service remains ClusterIP; external reachability is provided
	// via explicitly assigned external IPs and platform networking.
	Enabled bool `json:"enabled"`

	// ExternalIPs are externally routable addresses assigned to the global
	// multiadmin-web Service. These are surfaced via Service.spec.externalIPs.
	// +optional
	// +kubebuilder:validation:MaxItems=10
	ExternalIPs []IPAddress `json:"externalIPs,omitempty"`

	// Annotations are applied to the global multiadmin-web Service metadata.
	// The operator owns exactly these annotation keys via SSA field ownership.
	// +optional
	// +kubebuilder:validation:MaxProperties=20
	Annotations map[string]string `json:"annotations,omitempty"`
}

ExternalAdminWebConfig controls external exposure of the global multiadmin-web Service.

Annotations under the multigres.com/ prefix are rejected to avoid conflicts with operator-managed metadata. +kubebuilder:validation:XValidation:rule="!has(self.annotations) || self.annotations.all(k, !k.startsWith('multigres.com/'))",message="annotations must not use multigres.com/ prefix (reserved for operator)"

func (*ExternalAdminWebConfig) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalAdminWebConfig.

func (*ExternalAdminWebConfig) DeepCopyInto

func (in *ExternalAdminWebConfig) DeepCopyInto(out *ExternalAdminWebConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ExternalGatewayConfig

type ExternalGatewayConfig struct {
	// Enabled controls whether external gateway exposure is enabled.
	// The global Service remains ClusterIP; external reachability is provided
	// via explicitly assigned external IPs and platform networking.
	Enabled bool `json:"enabled"`

	// ExternalIPs are externally routable addresses assigned to the global
	// multigateway Service. These are surfaced via Service.spec.externalIPs.
	// +optional
	// +kubebuilder:validation:MaxItems=10
	ExternalIPs []IPAddress `json:"externalIPs,omitempty"`

	// Annotations are applied to the global multigateway Service metadata.
	// The operator owns exactly these annotation keys via SSA field ownership.
	// +optional
	// +kubebuilder:validation:MaxProperties=20
	Annotations map[string]string `json:"annotations,omitempty"`
}

ExternalGatewayConfig controls external exposure of the global multigateway Service.

Annotations under the multigres.com/ prefix are rejected to avoid conflicts with operator-managed metadata. +kubebuilder:validation:XValidation:rule="!has(self.annotations) || self.annotations.all(k, !k.startsWith('multigres.com/'))",message="annotations must not use multigres.com/ prefix (reserved for operator)"

func (*ExternalGatewayConfig) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalGatewayConfig.

func (*ExternalGatewayConfig) DeepCopyInto

func (in *ExternalGatewayConfig) DeepCopyInto(out *ExternalGatewayConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ExternalTopoServerSpec

type ExternalTopoServerSpec struct {
	// Endpoints is a list of client URLs.
	// +kubebuilder:validation:MinItems=1
	// +kubebuilder:validation:MaxItems=20
	// +kubebuilder:validation:XValidation:rule="self.all(x, x.matches('^https?://'))",message="endpoints must be valid URLs"
	// +listType=set
	Endpoints []EndpointUrl `json:"endpoints"`

	// Implementation is the topology implementation type (e.g., "etcd", "memory").
	// Defaults to "etcd" if not specified.
	// +optional
	Implementation string `json:"implementation,omitempty"`

	// CASecret is the name of the secret containing the CA certificate.
	// +optional
	// +kubebuilder:validation:MaxLength=253
	CASecret string `json:"caSecret,omitempty"`

	// ClientCertSecret is the name of the secret containing the client cert/key.
	// +optional
	// +kubebuilder:validation:MaxLength=253
	ClientCertSecret string `json:"clientCertSecret,omitempty"`

	// RootPath is the etcd prefix for this cluster.
	// +optional
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=512
	RootPath string `json:"rootPath,omitempty"`
}

ExternalTopoServerSpec defines connection details for an external system.

func (*ExternalTopoServerSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalTopoServerSpec.

func (*ExternalTopoServerSpec) DeepCopyInto

func (in *ExternalTopoServerSpec) DeepCopyInto(out *ExternalTopoServerSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type FilesystemBackupConfig

type FilesystemBackupConfig struct {
	// Path is the filesystem directory for backups.
	// Defaults to "/backups".
	// +optional
	Path string `json:"path,omitempty"`

	// Storage defines the PVC configuration for the backup volume.
	// This volume is shared by all pools in the shard (per-cell).
	// +optional
	Storage StorageSpec `json:"storage,omitempty"`
}

FilesystemBackupConfig defines settings for filesystem-based backups.

func (*FilesystemBackupConfig) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FilesystemBackupConfig.

func (*FilesystemBackupConfig) DeepCopyInto

func (in *FilesystemBackupConfig) DeepCopyInto(out *FilesystemBackupConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GatewayStatus

type GatewayStatus struct {
	// ExternalEndpoint is the hostname or IP for the external gateway endpoint,
	// sourced from externalIPs or load balancer ingress (in that priority).
	// Empty when no external endpoint has been provisioned.
	ExternalEndpoint string `json:"externalEndpoint"`
}

GatewayStatus reports the external gateway state.

func (*GatewayStatus) DeepCopy

func (in *GatewayStatus) DeepCopy() *GatewayStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayStatus.

func (*GatewayStatus) DeepCopyInto

func (in *GatewayStatus) DeepCopyInto(out *GatewayStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GlobalTopoServerRef

type GlobalTopoServerRef struct {
	// Address is the DNS address of the topology server.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=512
	Address string `json:"address"`

	// RootPath is the etcd prefix for this cluster.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=512
	RootPath string `json:"rootPath"`

	// Implementation defines the client implementation (e.g. "etcd").
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=63
	Implementation string `json:"implementation"`
}

GlobalTopoServerRef defines a reference to the global topo server. Used by Cell, TableGroup, and Shard.

func (*GlobalTopoServerRef) DeepCopy

func (in *GlobalTopoServerRef) DeepCopy() *GlobalTopoServerRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalTopoServerRef.

func (*GlobalTopoServerRef) DeepCopyInto

func (in *GlobalTopoServerRef) DeepCopyInto(out *GlobalTopoServerRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GlobalTopoServerSpec

type GlobalTopoServerSpec struct {
	// Etcd defines an inline managed Etcd cluster.
	// +optional
	Etcd *EtcdSpec `json:"etcd,omitempty"`

	// External defines connection details for an unmanaged, external topo server.
	// +optional
	External *ExternalTopoServerSpec `json:"external,omitempty"`

	// TemplateRef refers to a CoreTemplate to load configuration from.
	// +optional
	TemplateRef TemplateRef `json:"templateRef,omitempty"`

	// PVCDeletionPolicy controls PVC lifecycle for topology server.
	// Overrides MultigresCluster setting.
	// +optional
	PVCDeletionPolicy *PVCDeletionPolicy `json:"pvcDeletionPolicy,omitempty"`
}

GlobalTopoServerSpec defines the configuration for the global topology server. It can be either an inline Etcd spec, an External reference, or a Template reference. +kubebuilder:validation:XValidation:rule="[has(self.etcd), has(self.external), has(self.templateRef)].filter(x, x).size() == 1",message="must specify exactly one of 'etcd', 'external', or 'templateRef'"

func (*GlobalTopoServerSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalTopoServerSpec.

func (*GlobalTopoServerSpec) DeepCopyInto

func (in *GlobalTopoServerSpec) DeepCopyInto(out *GlobalTopoServerSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type IPAddress

type IPAddress string

IPAddress is a validated IPv4 or IPv6 address string. +kubebuilder:validation:MinLength=3 +kubebuilder:validation:MaxLength=45 +kubebuilder:validation:Pattern=`^(([0-9]{1,3}\.){3}[0-9]{1,3})$|^(([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4})$`

type ImageRef

type ImageRef string

ImageRef is a container image reference. +kubebuilder:validation:MinLength=1 +kubebuilder:validation:MaxLength=512

type InitdbArgs

type InitdbArgs string

InitdbArgs is an opaque string of extra arguments forwarded to initdb during PostgreSQL data directory initialization. +kubebuilder:validation:MaxLength=512

type LocalTopoServerSpec

type LocalTopoServerSpec struct {
	// Etcd defines an inline managed Etcd cluster.
	// +optional
	Etcd *EtcdSpec `json:"etcd,omitempty"`

	// External defines connection details for an unmanaged, external topo server.
	// +optional
	External *ExternalTopoServerSpec `json:"external,omitempty"`
}

LocalTopoServerSpec defines configuration for Cell-local topology. +kubebuilder:validation:XValidation:rule="has(self.etcd) || has(self.external)",message="must specify either 'etcd' or 'external'" +kubebuilder:validation:XValidation:rule="!(has(self.etcd) && has(self.external))",message="only one of 'etcd' or 'external' can be set"

func (*LocalTopoServerSpec) DeepCopy

func (in *LocalTopoServerSpec) DeepCopy() *LocalTopoServerSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalTopoServerSpec.

func (*LocalTopoServerSpec) DeepCopyInto

func (in *LocalTopoServerSpec) DeepCopyInto(out *LocalTopoServerSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LogLevel

type LogLevel string

LogLevel is a validated log level string for multigres components. +kubebuilder:validation:Enum=debug;info;warn;error

type MultiAdminConfig

type MultiAdminConfig struct {
	// Spec defines the inline configuration.
	// +optional
	Spec *StatelessSpec `json:"spec,omitempty"`

	// TemplateRef refers to a CoreTemplate to load configuration from.
	// +optional
	TemplateRef TemplateRef `json:"templateRef,omitempty"`
}

MultiAdminConfig defines the configuration for MultiAdmin in the Cluster. It allows either an inline spec OR a reference to a CoreTemplate. +kubebuilder:validation:XValidation:rule="has(self.spec) || has(self.templateRef)",message="must specify either 'spec' or 'templateRef'" +kubebuilder:validation:XValidation:rule="!(has(self.spec) && has(self.templateRef))",message="cannot specify both 'spec' and 'templateRef'"

func (*MultiAdminConfig) DeepCopy

func (in *MultiAdminConfig) DeepCopy() *MultiAdminConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultiAdminConfig.

func (*MultiAdminConfig) DeepCopyInto

func (in *MultiAdminConfig) DeepCopyInto(out *MultiAdminConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MultiAdminWebConfig

type MultiAdminWebConfig struct {
	// Spec defines the inline configuration.
	// +optional
	Spec *StatelessSpec `json:"spec,omitempty"`

	// TemplateRef refers to a CoreTemplate to load configuration from.
	// +optional
	TemplateRef TemplateRef `json:"templateRef,omitempty"`
}

MultiAdminWebConfig defines the configuration for MultiAdminWeb in the Cluster. It allows either an inline spec OR a reference to a CoreTemplate. +kubebuilder:validation:XValidation:rule="has(self.spec) || has(self.templateRef)",message="must specify either 'spec' or 'templateRef'" +kubebuilder:validation:XValidation:rule="!(has(self.spec) && has(self.templateRef))",message="cannot specify both 'spec' and 'templateRef'"

func (*MultiAdminWebConfig) DeepCopy

func (in *MultiAdminWebConfig) DeepCopy() *MultiAdminWebConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultiAdminWebConfig.

func (*MultiAdminWebConfig) DeepCopyInto

func (in *MultiAdminWebConfig) DeepCopyInto(out *MultiAdminWebConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MultiOrchSpec

type MultiOrchSpec struct {
	StatelessSpec `json:",inline"`

	// Placement defines optional scheduling settings for multiorch pods.
	// +optional
	Placement *PodPlacementSpec `json:"placement,omitempty"`

	// Cells defines the list of cells where this MultiOrch should be deployed.
	// If empty, it defaults to all cells where pools are defined.
	// +optional
	// +listType=set
	// +kubebuilder:validation:MaxItems=50
	Cells []CellName `json:"cells,omitempty"`
}

MultiOrchSpec defines the configuration specifically for MultiOrch, which requires placement logic (cell targeting).

func (*MultiOrchSpec) DeepCopy

func (in *MultiOrchSpec) DeepCopy() *MultiOrchSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultiOrchSpec.

func (*MultiOrchSpec) DeepCopyInto

func (in *MultiOrchSpec) DeepCopyInto(out *MultiOrchSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MultigresCluster

type MultigresCluster struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   MultigresClusterSpec   `json:"spec,omitempty"`
	Status MultigresClusterStatus `json:"status,omitempty"`
}

MultigresCluster represents a distributed database cluster managed by the operator. +kubebuilder:resource:shortName=mgc +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase" +kubebuilder:validation:XValidation:rule="self.metadata.name.size() <= 25",message="MultigresCluster name must be at most 25 characters"

func (*MultigresCluster) DeepCopy

func (in *MultigresCluster) DeepCopy() *MultigresCluster

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultigresCluster.

func (*MultigresCluster) DeepCopyInto

func (in *MultigresCluster) DeepCopyInto(out *MultigresCluster)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*MultigresCluster) DeepCopyObject

func (in *MultigresCluster) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type MultigresClusterList

type MultigresClusterList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []MultigresCluster `json:"items"`
}

MultigresClusterList contains a list of MultigresCluster

func (*MultigresClusterList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultigresClusterList.

func (*MultigresClusterList) DeepCopyInto

func (in *MultigresClusterList) DeepCopyInto(out *MultigresClusterList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*MultigresClusterList) DeepCopyObject

func (in *MultigresClusterList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type MultigresClusterSpec

type MultigresClusterSpec struct {
	// Images defines the container images for all components in the cluster.
	// +optional
	Images ClusterImages `json:"images,omitempty"`

	// LogLevels configures the --log-level flag for each multigres data-plane component.
	// All fields default to "info" if not specified.
	// +optional
	LogLevels ComponentLogLevels `json:"logLevels,omitempty"`

	// TemplateDefaults defines the default templates to use for components
	// that do not have explicit specs.
	// +optional
	TemplateDefaults TemplateDefaults `json:"templateDefaults,omitempty"`

	// GlobalTopoServer defines the cluster-wide global topology server.
	// +optional
	GlobalTopoServer *GlobalTopoServerSpec `json:"globalTopoServer,omitempty"`

	// MultiAdmin defines the configuration for the MultiAdmin component.
	// +optional
	MultiAdmin *MultiAdminConfig `json:"multiadmin,omitempty"`

	// MultiAdminWeb defines the configuration for the MultiAdminWeb component.
	// +optional
	MultiAdminWeb *MultiAdminWebConfig `json:"multiadminWeb,omitempty"`

	// Cells defines the list of cells (failure domains) in the cluster.
	// +optional
	// +listType=map
	// +listMapKey=name
	// +kubebuilder:validation:MaxItems=50
	// +kubebuilder:validation:XValidation:rule="oldSelf.all(c, c.name in self.map(x, x.name))",message="Cells cannot be removed or renamed (Append-Only)"
	Cells []CellConfig `json:"cells,omitempty"`

	// Databases defines the logical databases, table groups, and sharding.
	// +optional
	// +listType=map
	// +listMapKey=name
	// +kubebuilder:validation:MaxItems=1
	// +kubebuilder:validation:XValidation:rule="self.all(db, db.name == 'postgres' && db.default == true)",message="in v1alpha1, only the single system database named 'postgres' (marked default: true) is supported"
	Databases []DatabaseConfig `json:"databases,omitempty"`

	// PVCDeletionPolicy controls PVC lifecycle management for all stateful components.
	// Defaults to Retain/Delete — PVCs are kept on cluster deletion but removed on scale-down.
	// +optional
	// +kubebuilder:default={whenDeleted: "Retain", whenScaled: "Delete"}
	PVCDeletionPolicy *PVCDeletionPolicy `json:"pvcDeletionPolicy,omitempty"`

	// Observability configures OpenTelemetry for data-plane components.
	// When nil, data-plane pods inherit the operator's own OTEL environment
	// variables at reconcile time. Set fields to override or disable.
	// +optional
	Observability *ObservabilityConfig `json:"observability,omitempty"`

	// Backup configures the default backup settings for the entire cluster.
	// +optional
	Backup *BackupConfig `json:"backup,omitempty"`

	// ExternalGateway controls external exposure of the global multigateway Service.
	// When nil or enabled: false, the Service remains ClusterIP.
	// +optional
	ExternalGateway *ExternalGatewayConfig `json:"externalGateway,omitempty"`

	// ExternalAdminWeb controls external exposure of the global multiadmin-web Service.
	// When nil or enabled: false, the Service remains ClusterIP.
	// +optional
	ExternalAdminWeb *ExternalAdminWebConfig `json:"externalAdminWeb,omitempty"`

	// TopologyPruning controls whether stale topology entries are pruned.
	// Default: enabled (nil means pruning is on).
	// +optional
	TopologyPruning *TopologyPruningConfig `json:"topologyPruning,omitempty"`

	// DurabilityPolicy sets the default durability policy for all databases in the cluster.
	// This value is written to the topology and determines how multiorch enforces
	// synchronous replication acknowledgment during failover.
	//
	// Currently supported values (upstream multiorch):
	//   - "AT_LEAST_2": any 2 nodes must acknowledge writes (single-cell quorum)
	//   - "MULTI_CELL_AT_LEAST_2": any 2 nodes from different cells must acknowledge (cross-AZ quorum)
	//
	// Additional user-defined policies may be supported in future upstream releases.
	// Defaults to "AT_LEAST_2" if not set.
	// +optional
	DurabilityPolicy string `json:"durabilityPolicy,omitempty"`
}

MultigresClusterSpec defines the desired state of MultigresCluster.

func (*MultigresClusterSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultigresClusterSpec.

func (*MultigresClusterSpec) DeepCopyInto

func (in *MultigresClusterSpec) DeepCopyInto(out *MultigresClusterSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MultigresClusterStatus

type MultigresClusterStatus struct {
	// ObservedGeneration is the most recent generation observed.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// Conditions represent the latest available observations.
	// +optional
	// +listType=map
	// +listMapKey=type
	Conditions []metav1.Condition `json:"conditions,omitempty"`

	// Phase represents the aggregated lifecycle state of the cluster.
	// +optional
	Phase Phase `json:"phase,omitempty"`

	// Message provides details about the current phase (e.g. error messages).
	// +optional
	Message string `json:"message,omitempty"`

	// Cells status summary.
	// +optional
	// +kubebuilder:validation:MaxProperties=50
	Cells map[CellName]CellStatusSummary `json:"cells,omitempty"`

	// Gateway reports the external gateway state.
	// Nil when spec.externalGateway is nil or disabled.
	// +optional
	Gateway *GatewayStatus `json:"gateway,omitempty"`

	// AdminWeb reports the external admin web state.
	// Nil when spec.externalAdminWeb is nil or disabled.
	// +optional
	AdminWeb *AdminWebStatus `json:"adminWeb,omitempty"`

	// Databases status summary.
	// +optional
	// +kubebuilder:validation:MaxProperties=50
	Databases map[DatabaseName]DatabaseStatusSummary `json:"databases,omitempty"`

	// ResolvedTemplates records which templates were resolved during the last
	// successful reconciliation. Used for targeted template-change enqueuing.
	// +optional
	ResolvedTemplates *ResolvedTemplates `json:"resolvedTemplates,omitempty"`
}

MultigresClusterStatus defines the observed state.

func (*MultigresClusterStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultigresClusterStatus.

func (*MultigresClusterStatus) DeepCopyInto

func (in *MultigresClusterStatus) DeepCopyInto(out *MultigresClusterStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ObservabilityConfig

type ObservabilityConfig struct {
	// OTLPEndpoint is the OTLP collector endpoint URL.
	// Maps to OTEL_EXPORTER_OTLP_ENDPOINT.
	// Example: "http://otel-collector:4318"
	// Set to "disabled" to explicitly disable telemetry.
	// +optional
	OTLPEndpoint string `json:"otlpEndpoint,omitempty"`

	// OTLPProtocol is the OTLP transport protocol.
	// Maps to OTEL_EXPORTER_OTLP_PROTOCOL.
	// +optional
	// +kubebuilder:validation:Enum="http/protobuf";"grpc"
	OTLPProtocol string `json:"otlpProtocol,omitempty"`

	// TracesExporter selects the trace exporter.
	// Maps to OTEL_TRACES_EXPORTER.
	// Upstream defaults to "none" — set to "otlp" to enable tracing.
	// +optional
	// +kubebuilder:validation:Enum=otlp;none;console
	TracesExporter string `json:"tracesExporter,omitempty"`

	// MetricsExporter selects the metrics exporter.
	// Maps to OTEL_METRICS_EXPORTER.
	// Upstream defaults to "none" — set to "otlp" to enable metrics export.
	// +optional
	// +kubebuilder:validation:Enum=otlp;none;console
	MetricsExporter string `json:"metricsExporter,omitempty"`

	// LogsExporter selects the logs exporter.
	// Maps to OTEL_LOGS_EXPORTER.
	// Upstream defaults to "none" — set to "otlp" to enable log export.
	// +optional
	// +kubebuilder:validation:Enum=otlp;none;console
	LogsExporter string `json:"logsExporter,omitempty"`

	// MetricExportInterval in milliseconds.
	// Maps to OTEL_METRIC_EXPORT_INTERVAL.
	// +optional
	MetricExportInterval string `json:"metricExportInterval,omitempty"`

	// MetricsTemporality selects the temporality preference.
	// Maps to OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE.
	// +optional
	// +kubebuilder:validation:Enum=cumulative;delta
	MetricsTemporality string `json:"metricsTemporality,omitempty"`

	// HistogramAggregation selects the default histogram aggregation.
	// Maps to OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION.
	// Use "base2_exponential_bucket_histogram" for native/exponential histograms
	// which are more compact and accurate than explicit bucket histograms.
	// +optional
	// +kubebuilder:validation:Enum=base2_exponential_bucket_histogram;explicit_bucket_histogram
	HistogramAggregation string `json:"histogramAggregation,omitempty"`

	// TracesSampler selects the sampler.
	// Maps to OTEL_TRACES_SAMPLER.
	// Standard values: always_on, always_off, parentbased_traceidratio.
	// Use "multigres_custom" for file-based sampling (requires SamplingConfigRef).
	// +optional
	TracesSampler string `json:"tracesSampler,omitempty"`

	// SamplingConfigRef references a ConfigMap containing the sampling config file.
	// Only used when tracesSampler is "multigres_custom".
	// The ConfigMap is mounted at /etc/otel/ and the file path is passed
	// via OTEL_TRACES_SAMPLER_CONFIG.
	// +optional
	SamplingConfigRef *SamplingConfigRef `json:"samplingConfigRef,omitempty"`
}

ObservabilityConfig defines OpenTelemetry settings for data-plane components. All fields are optional. When a field is empty, the operator's own corresponding OTEL_* environment variable is used as the default at reconcile time. Set otlpEndpoint to "disabled" to explicitly disable telemetry regardless of operator settings.

func (*ObservabilityConfig) DeepCopy

func (in *ObservabilityConfig) DeepCopy() *ObservabilityConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObservabilityConfig.

func (*ObservabilityConfig) DeepCopyInto

func (in *ObservabilityConfig) DeepCopyInto(out *ObservabilityConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PVCDeletionPolicy

type PVCDeletionPolicy struct {
	// WhenDeleted controls PVC deletion when the MultigresCluster is deleted.
	// - Retain (default): PVCs are kept for manual review and recovery
	// - Delete: PVCs are automatically deleted with the cluster
	// +optional
	// +kubebuilder:default=Retain
	WhenDeleted PVCRetentionPolicyType `json:"whenDeleted,omitempty"`

	// WhenScaled controls PVC deletion when replicas are scaled down.
	// - Delete (default): PVCs are automatically deleted when pods are removed
	// - Retain: PVCs from scaled-down pods are kept for manual recovery
	// +optional
	// +kubebuilder:default=Delete
	WhenScaled PVCRetentionPolicyType `json:"whenScaled,omitempty"`
}

PVCDeletionPolicy controls PVC lifecycle management for stateful components.

func MergePVCDeletionPolicy

func MergePVCDeletionPolicy(child, parent *PVCDeletionPolicy) *PVCDeletionPolicy

MergePVCDeletionPolicy merges child and parent policies with child taking precedence. If child is nil, returns parent. If both nil, returns nil (caller uses default Retain).

func (*PVCDeletionPolicy) DeepCopy

func (in *PVCDeletionPolicy) DeepCopy() *PVCDeletionPolicy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PVCDeletionPolicy.

func (*PVCDeletionPolicy) DeepCopyInto

func (in *PVCDeletionPolicy) DeepCopyInto(out *PVCDeletionPolicy)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PVCRetentionPolicyType

type PVCRetentionPolicyType string

PVCRetentionPolicyType defines when to delete PVCs. +kubebuilder:validation:Enum=Retain;Delete

const (
	// RetainPVCRetentionPolicy keeps PVCs when resources are deleted or scaled down.
	RetainPVCRetentionPolicy PVCRetentionPolicyType = "Retain"
	// DeletePVCRetentionPolicy automatically deletes PVCs when resources are deleted or scaled down.
	DeletePVCRetentionPolicy PVCRetentionPolicyType = "Delete"
)

type PgBackRestTLSConfig

type PgBackRestTLSConfig struct {
	// SecretName is the name of an existing Secret containing pgBackRest TLS certificates.
	// The Secret must contain three keys: ca.crt, tls.crt, tls.key.
	// This is directly compatible with cert-manager Certificate resources.
	// When empty, the operator generates and rotates certificates automatically.
	// +optional
	SecretName string `json:"secretName,omitempty"`
}

PgBackRestTLSConfig configures TLS for pgBackRest inter-node communication.

func (*PgBackRestTLSConfig) DeepCopy

func (in *PgBackRestTLSConfig) DeepCopy() *PgBackRestTLSConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PgBackRestTLSConfig.

func (*PgBackRestTLSConfig) DeepCopyInto

func (in *PgBackRestTLSConfig) DeepCopyInto(out *PgBackRestTLSConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Phase

type Phase string

Phase represents the lifecycle state of a Multigres resource. +kubebuilder:validation:Enum=Initializing;Progressing;Healthy;Degraded;Unknown

const (
	PhaseInitializing Phase = "Initializing" // Resource is being created
	PhaseProgressing  Phase = "Progressing"  // Desired state not yet achieved (rolling update)
	PhaseHealthy      Phase = "Healthy"      // Desired state reached
	PhaseDegraded     Phase = "Degraded"     // Resource is failing / crashing
	PhaseUnknown      Phase = "Unknown"
)

type PodPlacementSpec

type PodPlacementSpec struct {
	// Tolerations defines the pod tolerations for scheduling onto tainted nodes.
	// +optional
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
}

PodPlacementSpec contains pod scheduling knobs that are intentionally exposed only for components that need them today. It is separate from StatelessSpec so unrelated stateless components do not automatically inherit these fields.

func (*PodPlacementSpec) DeepCopy

func (in *PodPlacementSpec) DeepCopy() *PodPlacementSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodPlacementSpec.

func (*PodPlacementSpec) DeepCopyInto

func (in *PodPlacementSpec) DeepCopyInto(out *PodPlacementSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PoolName

type PoolName string

PoolName is a validated name for a connection pool within a shard. +kubebuilder:validation:MinLength=1 +kubebuilder:validation:MaxLength=25 +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`

type PoolSpec

type PoolSpec struct {
	// Type of the pool. Currently only "readWrite" is supported.
	// +kubebuilder:validation:Enum=readWrite
	// +optional
	Type PoolType `json:"type,omitempty"`

	// Cells defines the list of cells where this Pool should be deployed.
	// +optional
	// +listType=set
	// +kubebuilder:validation:MinItems=1
	// +kubebuilder:validation:MaxItems=10
	// +kubebuilder:validation:XValidation:rule="oldSelf.all(c, c in self)",message="Cells cannot be removed from a pool (Append-Only)"
	Cells []CellName `json:"cells,omitempty"`

	// ReplicasPerCell is the desired number of Postgres data pods PER CELL in this pool.
	// Sidecars (like Multipooler) will scale alongside the Postgres pods.
	// Minimum 1 is required; readWrite pools need at least 3 for zero-downtime rolling upgrades
	// (AT_LEAST_2 durability requires 1 primary + 2 standbys to maintain quorum during drain).
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:Maximum=32
	// +optional
	ReplicasPerCell *int32 `json:"replicasPerCell,omitempty"`

	// Storage defines the storage configuration for the pool's data volumes.
	// +optional
	Storage StorageSpec `json:"storage,omitempty"`

	// Postgres container configuration.
	// +optional
	Postgres ContainerConfig `json:"postgres,omitempty"`

	// Multipooler container configuration.
	// +optional
	Multipooler ContainerConfig `json:"multipooler,omitempty"`

	// Affinity defines the pod's scheduling constraints.
	// +optional
	Affinity *corev1.Affinity `json:"affinity,omitempty"`

	// Tolerations defines the pod tolerations for scheduling onto tainted nodes.
	// +optional
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

	// FSGroup sets the pod-level fsGroup for shared volume and socket access across
	// pool containers. When unset, runtime defaults apply.
	// +optional
	// +kubebuilder:validation:Minimum=1
	FSGroup *int64 `json:"fsGroup,omitempty"`

	// PVCDeletionPolicy controls PVC lifecycle for this pool.
	// Overrides Shard, TableGroup, and MultigresCluster settings.
	// +optional
	PVCDeletionPolicy *PVCDeletionPolicy `json:"pvcDeletionPolicy,omitempty"`
}

PoolSpec defines the configuration for a data pool (StatefulSet).

func (*PoolSpec) DeepCopy

func (in *PoolSpec) DeepCopy() *PoolSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PoolSpec.

func (*PoolSpec) DeepCopyInto

func (in *PoolSpec) DeepCopyInto(out *PoolSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PoolType

type PoolType string

PoolType constrains the allowed pool access patterns. +kubebuilder:validation:Enum=readWrite

type PostgresConfigRef

type PostgresConfigRef struct {
	// Name is the name of the ConfigMap.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=253
	Name string `json:"name"`

	// Key is the key within the ConfigMap's data that contains the postgresql.conf content.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=253
	Key string `json:"key"`
}

PostgresConfigRef references a ConfigMap containing custom postgresql.conf content. The referenced ConfigMap must exist in the same namespace as the MultigresCluster.

func (*PostgresConfigRef) DeepCopy

func (in *PostgresConfigRef) DeepCopy() *PostgresConfigRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgresConfigRef.

func (*PostgresConfigRef) DeepCopyInto

func (in *PostgresConfigRef) DeepCopyInto(out *PostgresConfigRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Region

type Region string

Region is the cloud provider region identifier. +kubebuilder:validation:MinLength=1 +kubebuilder:validation:MaxLength=63

type ResolvedTemplates

type ResolvedTemplates struct {
	// CoreTemplates is the deduplicated set of CoreTemplate names resolved.
	// +optional
	CoreTemplates []TemplateRef `json:"coreTemplates,omitempty"`

	// CellTemplates is the deduplicated set of CellTemplate names resolved.
	// +optional
	CellTemplates []TemplateRef `json:"cellTemplates,omitempty"`

	// ShardTemplates is the deduplicated set of ShardTemplate names resolved.
	// +optional
	ShardTemplates []TemplateRef `json:"shardTemplates,omitempty"`
}

ResolvedTemplates tracks the template names resolved during reconciliation.

func (*ResolvedTemplates) DeepCopy

func (in *ResolvedTemplates) DeepCopy() *ResolvedTemplates

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResolvedTemplates.

func (*ResolvedTemplates) DeepCopyInto

func (in *ResolvedTemplates) DeepCopyInto(out *ResolvedTemplates)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type S3BackupConfig

type S3BackupConfig struct {
	// +kubebuilder:validation:MinLength=1
	Bucket string `json:"bucket"`
	// +kubebuilder:validation:MinLength=1
	Region            string `json:"region"`
	Endpoint          string `json:"endpoint,omitempty"`
	KeyPrefix         string `json:"keyPrefix,omitempty"`
	UseEnvCredentials bool   `json:"useEnvCredentials,omitempty"`

	// CredentialsSecret is the name of the Secret containing AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.
	// +optional
	CredentialsSecret string `json:"credentialsSecret,omitempty"`

	// ServiceAccountName is the name of the ServiceAccount to use for IRSA-based S3 authentication.
	// The ServiceAccount must exist in the same namespace and be annotated with
	// eks.amazonaws.com/role-arn pointing to an IAM role with S3 permissions.
	// The operator does NOT create this ServiceAccount — the user must create it externally.
	// +optional
	ServiceAccountName string `json:"serviceAccountName,omitempty"`
}

S3BackupConfig defines S3-compatible backup storage settings. +kubebuilder:validation:XValidation:rule="!(has(self.serviceAccountName) && size(self.serviceAccountName) > 0 && has(self.credentialsSecret) && size(self.credentialsSecret) > 0)",message="serviceAccountName and credentialsSecret are mutually exclusive" +kubebuilder:validation:XValidation:rule="!(has(self.serviceAccountName) && size(self.serviceAccountName) > 0 && has(self.useEnvCredentials) && self.useEnvCredentials)",message="serviceAccountName and useEnvCredentials are mutually exclusive — IRSA credentials are handled automatically"

func (*S3BackupConfig) DeepCopy

func (in *S3BackupConfig) DeepCopy() *S3BackupConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S3BackupConfig.

func (*S3BackupConfig) DeepCopyInto

func (in *S3BackupConfig) DeepCopyInto(out *S3BackupConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SamplingConfigRef

type SamplingConfigRef struct {
	// Name is the ConfigMap name (must be in the same namespace as the CR).
	Name string `json:"name"`

	// Key is the data key within the ConfigMap.
	// +kubebuilder:default="sampling-config.yaml"
	// +optional
	Key string `json:"key,omitempty"`
}

SamplingConfigRef references a ConfigMap with sampling configuration.

func (*SamplingConfigRef) DeepCopy

func (in *SamplingConfigRef) DeepCopy() *SamplingConfigRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SamplingConfigRef.

func (*SamplingConfigRef) DeepCopyInto

func (in *SamplingConfigRef) DeepCopyInto(out *SamplingConfigRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Shard

type Shard struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   ShardSpec   `json:"spec,omitempty"`
	Status ShardStatus `json:"status,omitempty"`
}

Shard represents a horizontal partition of a table group, managing pool pods and data-plane components. +kubebuilder:resource:shortName=srd +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase" +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.readyReplicas

func (*Shard) DeepCopy

func (in *Shard) DeepCopy() *Shard

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Shard.

func (*Shard) DeepCopyInto

func (in *Shard) DeepCopyInto(out *Shard)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Shard) DeepCopyObject

func (in *Shard) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ShardConfig

type ShardConfig struct {
	// Name is the identifier of the shard (e.g., "0", "1").
	// +kubebuilder:validation:XValidation:rule="self == '0-inf'",message="shardName must be strictly equal to '0-inf' in this version"
	Name ShardName `json:"name"`

	// ShardTemplate refers to a ShardTemplate CR.
	// +optional
	ShardTemplate TemplateRef `json:"shardTemplate,omitempty"`

	// Overrides are applied on top of the template.
	// +optional
	Overrides *ShardOverrides `json:"overrides,omitempty"`

	// Spec defines the inline configuration if no template is used.
	// +optional
	Spec *ShardInlineSpec `json:"spec,omitempty"`

	// Backup overrides the table group backup configuration for this specific shard.
	// +optional
	Backup *BackupConfig `json:"backup,omitempty"`
}

ShardConfig defines a specific shard. +kubebuilder:validation:XValidation:rule="!(has(self.spec) && has(self.shardTemplate))",message="cannot specify both 'spec' and 'shardTemplate'" +kubebuilder:validation:XValidation:rule="!(has(self.spec) && has(self.overrides))",message="cannot specify both 'spec' and 'overrides'"

func (*ShardConfig) DeepCopy

func (in *ShardConfig) DeepCopy() *ShardConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ShardConfig.

func (*ShardConfig) DeepCopyInto

func (in *ShardConfig) DeepCopyInto(out *ShardConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ShardImages

type ShardImages struct {
	// ImagePullPolicy overrides the default image pull policy.
	// +optional
	// +kubebuilder:validation:Enum=Always;Never;IfNotPresent
	ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`

	// ImagePullSecrets is a list of references to secrets in the same namespace.
	// +optional
	ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`

	// MultiOrch is the image for the shard orchestrator.
	MultiOrch ImageRef `json:"multiorch"`

	// MultiPooler is the image for the connection pooler sidecar.
	MultiPooler ImageRef `json:"multipooler"`

	// Postgres is the image for the postgres database.
	Postgres ImageRef `json:"postgres"`
}

ShardImages defines the images required for a Shard.

func (*ShardImages) DeepCopy

func (in *ShardImages) DeepCopy() *ShardImages

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ShardImages.

func (*ShardImages) DeepCopyInto

func (in *ShardImages) DeepCopyInto(out *ShardImages)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ShardInlineSpec

type ShardInlineSpec struct {
	// MultiOrch configuration.
	// +optional
	MultiOrch MultiOrchSpec `json:"multiorch,omitempty"`

	// InitdbArgs specifies extra arguments passed to initdb during PostgreSQL
	// data directory initialization (e.g., "--locale-provider=icu --icu-locale=en_US.UTF-8").
	// Applied uniformly to all pool pods in this shard.
	// Only takes effect when a pod initializes a new data directory.
	// +optional
	InitdbArgs InitdbArgs `json:"initdbArgs,omitempty"`

	// PostgresConfigRef references a ConfigMap containing custom postgresql.conf overrides.
	// The ConfigMap must exist in the same namespace. When set, the operator mounts it
	// and passes --postgres-config-template to pgctld.
	// +optional
	PostgresConfigRef *PostgresConfigRef `json:"postgresConfigRef,omitempty"`

	// Pools configuration. Keyed by pool name.
	// +optional
	// +kubebuilder:validation:MaxProperties=8
	// +kubebuilder:validation:XValidation:rule="self.all(key, size(key) <= 25)",message="pool names must be <= 25 chars"
	// +kubebuilder:validation:XValidation:rule="oldSelf.all(k, k in self)",message="Pools cannot be removed or renamed in this version (Append-Only)"
	Pools map[PoolName]PoolSpec `json:"pools,omitempty"`

	// PVCDeletionPolicy controls PVC lifecycle for pools in this shard.
	// Overrides TableGroup and MultigresCluster settings.
	// +optional
	PVCDeletionPolicy *PVCDeletionPolicy `json:"pvcDeletionPolicy,omitempty"`
}

ShardInlineSpec defines the inline configuration for a Shard.

func (*ShardInlineSpec) DeepCopy

func (in *ShardInlineSpec) DeepCopy() *ShardInlineSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ShardInlineSpec.

func (*ShardInlineSpec) DeepCopyInto

func (in *ShardInlineSpec) DeepCopyInto(out *ShardInlineSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ShardList

type ShardList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Shard `json:"items"`
}

ShardList contains a list of Shard

func (*ShardList) DeepCopy

func (in *ShardList) DeepCopy() *ShardList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ShardList.

func (*ShardList) DeepCopyInto

func (in *ShardList) DeepCopyInto(out *ShardList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ShardList) DeepCopyObject

func (in *ShardList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ShardName

type ShardName string

ShardName is a validated name for a shard within a table group. +kubebuilder:validation:MinLength=1 +kubebuilder:validation:MaxLength=25 +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`

type ShardOverrides

type ShardOverrides struct {
	// MultiOrch overrides.
	// +optional
	MultiOrch *MultiOrchSpec `json:"multiorch,omitempty"`

	// InitdbArgs overrides the template's initdb arguments.
	// +optional
	InitdbArgs InitdbArgs `json:"initdbArgs,omitempty"`

	// PostgresConfigRef references a ConfigMap containing custom postgresql.conf overrides.
	// The ConfigMap must exist in the same namespace. When set, the operator mounts it
	// and passes --postgres-config-template to pgctld.
	// +optional
	PostgresConfigRef *PostgresConfigRef `json:"postgresConfigRef,omitempty"`

	// Pools overrides. Keyed by pool name.
	// +optional
	// +kubebuilder:validation:MaxProperties=8
	// +kubebuilder:validation:XValidation:rule="self.all(key, size(key) <= 25)",message="pool names must be <= 25 chars"
	// +kubebuilder:validation:XValidation:rule="oldSelf.all(k, k in self)",message="Pools cannot be removed or renamed in this version (Append-Only)"
	Pools map[PoolName]PoolSpec `json:"pools,omitempty"`
}

ShardOverrides defines overrides for a ShardTemplate.

func (*ShardOverrides) DeepCopy

func (in *ShardOverrides) DeepCopy() *ShardOverrides

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ShardOverrides.

func (*ShardOverrides) DeepCopyInto

func (in *ShardOverrides) DeepCopyInto(out *ShardOverrides)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ShardResolvedSpec

type ShardResolvedSpec struct {
	// Name is the identifier of the shard.
	// +kubebuilder:validation:MaxLength=63
	Name string `json:"name"`

	// MultiOrch is the fully resolved configuration for the orchestrator.
	MultiOrch MultiOrchSpec `json:"multiorch"`

	// InitdbArgs is the resolved initdb arguments for this shard.
	// +optional
	InitdbArgs InitdbArgs `json:"initdbArgs,omitempty"`

	// PostgresConfigRef references a ConfigMap containing custom postgresql.conf overrides.
	// When set, the operator mounts it and passes --postgres-config-template to pgctld.
	// +optional
	PostgresConfigRef *PostgresConfigRef `json:"postgresConfigRef,omitempty"`

	// Pools is the map of fully resolved data pool configurations.
	// +kubebuilder:validation:MaxProperties=8
	// +kubebuilder:validation:XValidation:rule="self.all(key, size(key) < 63)",message="pool names must be < 63 chars"
	Pools map[PoolName]PoolSpec `json:"pools"`

	// PVCDeletionPolicy controls PVC lifecycle for pools in this shard.
	// Overrides TableGroup and MultigresCluster settings.
	// +optional
	PVCDeletionPolicy *PVCDeletionPolicy `json:"pvcDeletionPolicy,omitempty"`

	// Backup is the backup configuration inherited from MultigresCluster.
	// +optional
	Backup *BackupConfig `json:"backup,omitempty"`
}

ShardResolvedSpec represents the fully calculated spec for a shard, pushed down to the TableGroup.

func (*ShardResolvedSpec) DeepCopy

func (in *ShardResolvedSpec) DeepCopy() *ShardResolvedSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ShardResolvedSpec.

func (*ShardResolvedSpec) DeepCopyInto

func (in *ShardResolvedSpec) DeepCopyInto(out *ShardResolvedSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ShardSpec

type ShardSpec struct {
	// DatabaseName is the name of the logical database this shard belongs to.
	DatabaseName DatabaseName `json:"databaseName"`

	// TableGroupName is the name of the table group this shard belongs to.
	TableGroupName TableGroupName `json:"tableGroupName"`

	// ShardName is the specific identifier for this shard (e.g. "0").
	ShardName ShardName `json:"shardName"`

	// Images defines the container images to be used by this shard (defined globally at MultigresCluster).
	Images ShardImages `json:"images"`

	// GlobalTopoServer is a reference to the global topology server.
	GlobalTopoServer GlobalTopoServerRef `json:"globalTopoServer"`

	// MultiOrch is the fully resolved configuration for the shard orchestrator.
	MultiOrch MultiOrchSpec `json:"multiorch"`

	// InitdbArgs specifies extra arguments for initdb, propagated from the cluster spec.
	// +optional
	InitdbArgs InitdbArgs `json:"initdbArgs,omitempty"`

	// PostgresConfigRef references a ConfigMap containing custom postgresql.conf overrides.
	// When set, the operator mounts it and passes --postgres-config-template to pgctld.
	// +optional
	PostgresConfigRef *PostgresConfigRef `json:"postgresConfigRef,omitempty"`

	// Pools is the map of fully resolved data pool configurations.
	// +kubebuilder:validation:MaxProperties=8
	// +kubebuilder:validation:XValidation:rule="self.all(key, size(key) < 63)",message="pool names must be < 63 chars"
	Pools map[PoolName]PoolSpec `json:"pools"`

	// PVCDeletionPolicy controls PVC lifecycle for this shard's pools.
	// Inherited from MultigresCluster.
	// +optional
	PVCDeletionPolicy *PVCDeletionPolicy `json:"pvcDeletionPolicy,omitempty"`

	// Observability configures OpenTelemetry for shard-level data-plane components.
	// Inherited from MultigresCluster.Spec.Observability by the resolver.
	// +optional
	Observability *ObservabilityConfig `json:"observability,omitempty"`

	// LogLevels is the resolved log level configuration for shard-level components.
	// Inherited from MultigresCluster.Spec.LogLevels.
	// +optional
	LogLevels ComponentLogLevels `json:"logLevels,omitempty"`

	// Backup is the fully resolved backup configuration for this shard.
	// Inherited from MultigresCluster.Spec.Backup by the resolver.
	// +optional
	Backup *BackupConfig `json:"backup,omitempty"`

	// TopologyPruning controls whether stale topology entries are pruned.
	// Inherited from MultigresCluster.
	// +optional
	TopologyPruning *TopologyPruningConfig `json:"topologyPruning,omitempty"`

	// DurabilityPolicy is the resolved durability policy for this shard's database.
	// Inherited from MultigresCluster → Database.
	// +optional
	DurabilityPolicy string `json:"durabilityPolicy,omitempty"`

	// CellTopologyLabels maps cell names to their topology nodeSelector labels.
	// Each entry is a map like {"topology.kubernetes.io/zone": "us-east-1a"}.
	// Propagated from the cluster's cell configs so the shard controller
	// can inject nodeSelector without looking up Cell CRs.
	// +optional
	CellTopologyLabels map[CellName]map[string]string `json:"cellTopologyLabels,omitempty"`

	// Replicas is the total number of desired replicas across all pools in this shard.
	// This field is used by the scale subresource to support HPA and PDBs.
	// It is automatically populated by the cluster-handler based on the sum of ReplicasPerCell.
	// +optional
	Replicas *int32 `json:"replicas,omitempty"`
}

ShardSpec defines the desired state of Shard.

func (*ShardSpec) DeepCopy

func (in *ShardSpec) DeepCopy() *ShardSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ShardSpec.

func (*ShardSpec) DeepCopyInto

func (in *ShardSpec) DeepCopyInto(out *ShardSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ShardStatus

type ShardStatus struct {
	// ObservedGeneration is the most recent generation observed.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// Conditions represent the latest available observations.
	// +optional
	// +listType=map
	// +listMapKey=type
	Conditions []metav1.Condition `json:"conditions,omitempty"`

	// Phase represents the aggregated lifecycle state of the shard.
	// +optional
	Phase Phase `json:"phase,omitempty"`

	// Message provides details about the current phase.
	// +optional
	Message string `json:"message,omitempty"`

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

	// OrchReady indicates if the MultiOrch component is ready.
	OrchReady bool `json:"orchReady"`

	// PoolsReady indicates if all data pools are ready.
	PoolsReady bool `json:"poolsReady"`

	// LastBackupTime is the timestamp of the most recent completed backup.
	// +optional
	LastBackupTime *metav1.Time `json:"lastBackupTime,omitempty"`

	// LastBackupType is the type of the most recent completed backup (full, diff, incr).
	// +optional
	// +kubebuilder:validation:Enum=full;diff;incr
	LastBackupType string `json:"lastBackupType,omitempty"`

	// PodRoles maps pod names to their database roles (e.g. PRIMARY, REPLICA, DRAINED).
	// +optional
	PodRoles map[string]string `json:"podRoles,omitempty"`

	// ReadyReplicas is the total number of ready pods across all pools in this shard.
	// +optional
	ReadyReplicas int32 `json:"readyReplicas,omitempty"`
}

ShardStatus defines the observed state of Shard.

func (*ShardStatus) DeepCopy

func (in *ShardStatus) DeepCopy() *ShardStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ShardStatus.

func (*ShardStatus) DeepCopyInto

func (in *ShardStatus) DeepCopyInto(out *ShardStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ShardTemplate

type ShardTemplate struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec ShardTemplateSpec `json:"spec,omitempty"`
}

ShardTemplate provides reusable shard-level configuration (pools, storage, resources) for MultigresCluster shards. +kubebuilder:resource:shortName=sht

func (*ShardTemplate) DeepCopy

func (in *ShardTemplate) DeepCopy() *ShardTemplate

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ShardTemplate.

func (*ShardTemplate) DeepCopyInto

func (in *ShardTemplate) DeepCopyInto(out *ShardTemplate)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ShardTemplate) DeepCopyObject

func (in *ShardTemplate) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ShardTemplateList

type ShardTemplateList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []ShardTemplate `json:"items"`
}

ShardTemplateList contains a list of ShardTemplate

func (*ShardTemplateList) DeepCopy

func (in *ShardTemplateList) DeepCopy() *ShardTemplateList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ShardTemplateList.

func (*ShardTemplateList) DeepCopyInto

func (in *ShardTemplateList) DeepCopyInto(out *ShardTemplateList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ShardTemplateList) DeepCopyObject

func (in *ShardTemplateList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ShardTemplateSpec

type ShardTemplateSpec struct {
	// MultiOrch configuration.
	// +optional
	MultiOrch *MultiOrchSpec `json:"multiorch,omitempty"`

	// InitdbArgs specifies extra arguments passed to initdb during PostgreSQL
	// data directory initialization (e.g., "--locale-provider=icu --icu-locale=en_US.UTF-8").
	// Applied to all pool pods in shards using this template.
	// Only takes effect when a pod initializes a new data directory.
	// +optional
	InitdbArgs InitdbArgs `json:"initdbArgs,omitempty"`

	// PostgresConfigRef references a ConfigMap containing custom postgresql.conf overrides.
	// The ConfigMap must exist in the same namespace. When set, the operator mounts it
	// and passes --postgres-config-template to pgctld.
	// +optional
	PostgresConfigRef *PostgresConfigRef `json:"postgresConfigRef,omitempty"`

	// +optional
	// +kubebuilder:validation:MaxProperties=8
	// +kubebuilder:validation:XValidation:rule="self.all(key, size(key) < 63)",message="pool names must be < 63 chars"
	// +kubebuilder:validation:XValidation:rule="oldSelf.all(k, k in self)",message="Pools cannot be removed or renamed in this version (Append-Only)"
	Pools map[PoolName]PoolSpec `json:"pools,omitempty"`

	// PVCDeletionPolicy controls PVC lifecycle management for this shard template.
	// +optional
	PVCDeletionPolicy *PVCDeletionPolicy `json:"pvcDeletionPolicy,omitempty"`
}

ShardTemplateSpec defines reusable config for Shard components (MultiOrch, Pools).

func (*ShardTemplateSpec) DeepCopy

func (in *ShardTemplateSpec) DeepCopy() *ShardTemplateSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ShardTemplateSpec.

func (*ShardTemplateSpec) DeepCopyInto

func (in *ShardTemplateSpec) DeepCopyInto(out *ShardTemplateSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StatelessSpec

type StatelessSpec struct {
	// Replicas is the desired number of pods.
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=128
	// +optional
	Replicas *int32 `json:"replicas,omitempty"`

	// Resources defines the compute resource requirements.
	// +optional
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`

	// Affinity defines the pod's scheduling constraints.
	// +optional
	Affinity *corev1.Affinity `json:"affinity,omitempty"`

	// PodAnnotations are annotations to add to the pods.
	// +optional
	// +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=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"`
}

StatelessSpec defines the desired state for a scalable, stateless component like MultiAdmin, MultiOrch, or MultiGateway.

func (*StatelessSpec) DeepCopy

func (in *StatelessSpec) DeepCopy() *StatelessSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StatelessSpec.

func (*StatelessSpec) DeepCopyInto

func (in *StatelessSpec) DeepCopyInto(out *StatelessSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StorageSpec

type StorageSpec struct {
	// Size of the persistent volume.
	// +kubebuilder:validation:Pattern="^([0-9]+)(.+)$"
	// +kubebuilder:validation:MaxLength=63
	// +optional
	Size string `json:"size,omitempty"`

	// Class is the StorageClass name.
	// +optional
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=63
	Class string `json:"class,omitempty"`

	// AccessModes contains the desired access modes the volume should have.
	// More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes
	// +optional
	AccessModes []corev1.PersistentVolumeAccessMode `json:"accessModes,omitempty"`
}

StorageSpec defines the storage configuration.

func (*StorageSpec) DeepCopy

func (in *StorageSpec) DeepCopy() *StorageSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageSpec.

func (*StorageSpec) DeepCopyInto

func (in *StorageSpec) DeepCopyInto(out *StorageSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TableGroup

type TableGroup struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   TableGroupSpec   `json:"spec,omitempty"`
	Status TableGroupStatus `json:"status,omitempty"`
}

TableGroup represents a logical grouping of tables that are sharded together within a database. +kubebuilder:resource:shortName=tbg +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase"

func (*TableGroup) DeepCopy

func (in *TableGroup) DeepCopy() *TableGroup

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TableGroup.

func (*TableGroup) DeepCopyInto

func (in *TableGroup) DeepCopyInto(out *TableGroup)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TableGroup) DeepCopyObject

func (in *TableGroup) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type TableGroupConfig

type TableGroupConfig struct {
	// Name is the logical name of the table group.
	Name TableGroupName `json:"name"`

	// Default indicates if this is the default/unsharded group.
	// +optional
	Default bool `json:"default,omitempty"`

	// Shards defines the list of shards.
	// +optional
	// +listType=map
	// +listMapKey=name
	// +kubebuilder:validation:MaxItems=32
	Shards []ShardConfig `json:"shards,omitempty"`

	// Backup overrides the database backup configuration for this table group.
	// +optional
	Backup *BackupConfig `json:"backup,omitempty"`

	// PVCDeletionPolicy controls PVC lifecycle for shards in this table group.
	// Overrides MultigresCluster setting.
	// +optional
	PVCDeletionPolicy *PVCDeletionPolicy `json:"pvcDeletionPolicy,omitempty"`
}

TableGroupConfig defines a table group within a database. +kubebuilder:validation:XValidation:rule="!has(self.default) || !self.default || self.name == 'default'",message="the default tablegroup must be named 'default'"

func (*TableGroupConfig) DeepCopy

func (in *TableGroupConfig) DeepCopy() *TableGroupConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TableGroupConfig.

func (*TableGroupConfig) DeepCopyInto

func (in *TableGroupConfig) DeepCopyInto(out *TableGroupConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TableGroupList

type TableGroupList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []TableGroup `json:"items"`
}

TableGroupList contains a list of TableGroup

func (*TableGroupList) DeepCopy

func (in *TableGroupList) DeepCopy() *TableGroupList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TableGroupList.

func (*TableGroupList) DeepCopyInto

func (in *TableGroupList) DeepCopyInto(out *TableGroupList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TableGroupList) DeepCopyObject

func (in *TableGroupList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type TableGroupName

type TableGroupName string

TableGroupName is a validated name for a table group within a database. +kubebuilder:validation:MinLength=1 +kubebuilder:validation:MaxLength=25 +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`

type TableGroupSpec

type TableGroupSpec struct {
	// DatabaseName is the name of the logical database.
	DatabaseName DatabaseName `json:"databaseName"`

	// TableGroupName is the name of this table group.
	TableGroupName TableGroupName `json:"tableGroupName"`

	// IsDefault indicates if this is the default/unsharded group for the database.
	// +optional
	IsDefault bool `json:"default,omitempty"`

	// Images defines the container images used for child shards - defined globally in MultigresCluster.
	Images ShardImages `json:"images"`

	// GlobalTopoServer is a reference to the global topology server.
	GlobalTopoServer GlobalTopoServerRef `json:"globalTopoServer"`

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

	// PVCDeletionPolicy controls PVC lifecycle for all shards in this table group.
	// Inherited from MultigresCluster.
	// +optional
	PVCDeletionPolicy *PVCDeletionPolicy `json:"pvcDeletionPolicy,omitempty"`

	// Observability configures OpenTelemetry for shard-level data-plane components.
	// Inherited from MultigresCluster.Spec.Observability.
	// +optional
	Observability *ObservabilityConfig `json:"observability,omitempty"`

	// LogLevels is the resolved log level configuration for shard-level components.
	// Inherited from MultigresCluster.Spec.LogLevels.
	// +optional
	LogLevels ComponentLogLevels `json:"logLevels,omitempty"`

	// Backup is the backup configuration inherited from MultigresCluster -> Database -> TableGroup.
	// +optional
	Backup *BackupConfig `json:"backup,omitempty"`

	// CellTopologyLabels maps cell names to their topology nodeSelector labels.
	// Propagated from the cluster's cell configs.
	// +optional
	CellTopologyLabels map[CellName]map[string]string `json:"cellTopologyLabels,omitempty"`

	// TopologyPruning controls whether stale topology entries are pruned.
	// Inherited from MultigresCluster.
	// +optional
	TopologyPruning *TopologyPruningConfig `json:"topologyPruning,omitempty"`

	// DurabilityPolicy is the resolved durability policy for this database.
	// Inherited from MultigresCluster → Database.
	// +optional
	DurabilityPolicy string `json:"durabilityPolicy,omitempty"`
}

TableGroupSpec defines the desired state of TableGroup.

func (*TableGroupSpec) DeepCopy

func (in *TableGroupSpec) DeepCopy() *TableGroupSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TableGroupSpec.

func (*TableGroupSpec) DeepCopyInto

func (in *TableGroupSpec) DeepCopyInto(out *TableGroupSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TableGroupStatus

type TableGroupStatus struct {
	// ObservedGeneration is the most recent generation observed.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// Conditions represent the latest available observations.
	// +optional
	// +listType=map
	// +listMapKey=type
	Conditions []metav1.Condition `json:"conditions,omitempty"`

	// Phase represents the aggregated lifecycle state of the table group.
	// +optional
	Phase Phase `json:"phase,omitempty"`

	// Message provides details about the current phase.
	// +optional
	Message string `json:"message,omitempty"`

	// ReadyShards is the number of shards that have reached the Healthy phase.
	ReadyShards int32 `json:"readyShards"`
	// TotalShards is the total number of shards declared for this table group.
	TotalShards int32 `json:"totalShards"`
}

TableGroupStatus defines the observed state of TableGroup.

func (*TableGroupStatus) DeepCopy

func (in *TableGroupStatus) DeepCopy() *TableGroupStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TableGroupStatus.

func (*TableGroupStatus) DeepCopyInto

func (in *TableGroupStatus) DeepCopyInto(out *TableGroupStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TemplateDefaults

type TemplateDefaults struct {
	// CoreTemplate is the default template for global components.
	// +optional
	CoreTemplate TemplateRef `json:"coreTemplate,omitempty"`
	// CellTemplate is the default template for cells.
	// +optional
	CellTemplate TemplateRef `json:"cellTemplate,omitempty"`
	// ShardTemplate is the default template for shards.
	// +optional
	ShardTemplate TemplateRef `json:"shardTemplate,omitempty"`
}

TemplateDefaults defines the default templates to use for components.

func (*TemplateDefaults) DeepCopy

func (in *TemplateDefaults) DeepCopy() *TemplateDefaults

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemplateDefaults.

func (*TemplateDefaults) DeepCopyInto

func (in *TemplateDefaults) DeepCopyInto(out *TemplateDefaults)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TemplateRef

type TemplateRef string

TemplateRef is a reference to a named template resource (CoreTemplate, CellTemplate, or ShardTemplate). +kubebuilder:validation:MinLength=1 +kubebuilder:validation:MaxLength=63

type TopoServer

type TopoServer struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   TopoServerSpec   `json:"spec,omitempty"`
	Status TopoServerStatus `json:"status,omitempty"`
}

TopoServer represents the topology server (etcd) that stores cluster metadata and routing state. +kubebuilder:resource:shortName=tps +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase"

func (*TopoServer) DeepCopy

func (in *TopoServer) DeepCopy() *TopoServer

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TopoServer.

func (*TopoServer) DeepCopyInto

func (in *TopoServer) DeepCopyInto(out *TopoServer)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TopoServer) DeepCopyObject

func (in *TopoServer) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type TopoServerList

type TopoServerList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []TopoServer `json:"items"`
}

TopoServerList contains a list of TopoServer

func (*TopoServerList) DeepCopy

func (in *TopoServerList) DeepCopy() *TopoServerList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TopoServerList.

func (*TopoServerList) DeepCopyInto

func (in *TopoServerList) DeepCopyInto(out *TopoServerList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TopoServerList) DeepCopyObject

func (in *TopoServerList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type TopoServerSpec

type TopoServerSpec struct {
	// Etcd defines the configuration if using Etcd.
	Etcd *EtcdSpec `json:"etcd,omitempty"`

	// PVCDeletionPolicy controls PVC lifecycle for etcd.
	// Inherited from MultigresCluster.
	// +optional
	PVCDeletionPolicy *PVCDeletionPolicy `json:"pvcDeletionPolicy,omitempty"`
}

TopoServerSpec defines the desired state of TopoServer (Child CR). +kubebuilder:validation:XValidation:rule="has(self.etcd)",message="must specify 'etcd' configuration"

func (*TopoServerSpec) DeepCopy

func (in *TopoServerSpec) DeepCopy() *TopoServerSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TopoServerSpec.

func (*TopoServerSpec) DeepCopyInto

func (in *TopoServerSpec) DeepCopyInto(out *TopoServerSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TopoServerStatus

type TopoServerStatus struct {
	// ObservedGeneration is the most recent generation observed.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// Conditions represent the latest available observations.
	// +optional
	// +listType=map
	// +listMapKey=type
	Conditions []metav1.Condition `json:"conditions,omitempty"`

	// Phase represents the aggregated lifecycle state of the toposerver.
	// +optional
	Phase Phase `json:"phase,omitempty"`

	// Message provides details about the current phase.
	// +optional
	Message string `json:"message,omitempty"`

	// ClientService is the name of the service for clients.
	// +optional
	ClientService string `json:"clientService,omitempty"`

	// PeerService is the name of the service for peers.
	// +optional
	PeerService string `json:"peerService,omitempty"`
}

TopoServerStatus defines the observed state of TopoServer.

func (*TopoServerStatus) DeepCopy

func (in *TopoServerStatus) DeepCopy() *TopoServerStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TopoServerStatus.

func (*TopoServerStatus) DeepCopyInto

func (in *TopoServerStatus) DeepCopyInto(out *TopoServerStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TopologyPruningConfig

type TopologyPruningConfig struct {
	// Enabled controls whether the operator prunes stale topology entries.
	// When false, the operator still registers entries but never removes them.
	// Default: true (nil or empty means enabled).
	// +optional
	Enabled *bool `json:"enabled,omitempty"`
}

TopologyPruningConfig controls whether the operator prunes stale topology entries.

func (*TopologyPruningConfig) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TopologyPruningConfig.

func (*TopologyPruningConfig) DeepCopyInto

func (in *TopologyPruningConfig) DeepCopyInto(out *TopologyPruningConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TopologyReconciliation

type TopologyReconciliation struct {
	// RegisterCell indicates if the cell should register itself in the topology.
	RegisterCell bool `json:"registerCell"`

	// PrunePoolers indicates if unused poolers should be removed.
	PrunePoolers bool `json:"prunePoolers"`
}

TopologyReconciliation defines flags for the cell controller.

func (*TopologyReconciliation) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TopologyReconciliation.

func (*TopologyReconciliation) DeepCopyInto

func (in *TopologyReconciliation) DeepCopyInto(out *TopologyReconciliation)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Zone

type Zone string

Zone is the cloud provider availability zone identifier. +kubebuilder:validation:MinLength=1 +kubebuilder:validation:MaxLength=63

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL