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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 106 additions & 1 deletion apis/kubedb/v1/openapi_generated.go

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

30 changes: 30 additions & 0 deletions apis/kubedb/v1/postgres_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ type PostgresSpec struct {

// +optional
Replication *PostgresReplication `json:"replication,omitempty"`

// +optional
ReadReaplicas []ReadReplicaSpec `json:"readReaplicas,omitempty"`
}

type PostgresConfiguration struct {
Expand Down Expand Up @@ -219,6 +222,33 @@ type ArbiterSpec struct {
Tolerations []core.Toleration `json:"tolerations,omitempty"`
}

type ReadReplicaSpec struct {
// Name specifies the name of the read replica
Name string `json:"name"`
// Number of instances to deploy for a Postgres database.
Replicas *int32 `json:"replicas,omitempty"`
// Compute Resources required by the sidecar container.
// +optional
Resources core.ResourceRequirements `json:"resources,omitempty"`
// NodeSelector is a selector which must be true for the pod to fit on a node.
// Selector which must match a node's labels for the pod to be scheduled on that node.
// More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
// +optional
// +mapType=atomic
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
// If specified, the pod's tolerations.
// +optional
Tolerations []core.Toleration `json:"tolerations,omitempty"`
// StorageType can be durable (default) or ephemeral
StorageType StorageType `json:"storageType,omitempty"`
// Storage to specify how storage shall be used.
Storage *core.PersistentVolumeClaimSpec `json:"storage,omitempty"`
Copy link
Member

@souravbiswassanto souravbiswassanto Jan 27, 2026

Choose a reason for hiding this comment

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

Does it make sense to have different service for each read replica group? In that case we can add a serviceTemplate.

They asked about a feature where read going to a particular replica

// PodPlacementPolicy is the reference of the podPlacementPolicy
// +kubebuilder:default={name:"default"}
// +optional
PodPlacementPolicy *core.LocalObjectReference `json:"podPlacementPolicy,omitempty"`
}
Copy link
Member

Choose a reason for hiding this comment

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

we need a field for podPlacementPolicy. needed for distributed stuffs

Copy link
Member Author

@tamalsaha tamalsaha Jan 28, 2026

Choose a reason for hiding this comment

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

Add it. We need it for also placing these pods on Spot instances.


// PostgreLeaderElectionConfig contains essential attributes of leader election.
type PostgreLeaderElectionConfig struct {
// LeaseDuration is the duration in second that non-leader candidates will
Expand Down
53 changes: 53 additions & 0 deletions apis/kubedb/v1/zz_generated.deepcopy.go

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

1 change: 1 addition & 0 deletions apis/kubedb/v1alpha2/zz_generated.conversion.go

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

Loading
Loading