-
Notifications
You must be signed in to change notification settings - Fork 19
Add read replica support for Postgres #1580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -169,6 +169,9 @@ type PostgresSpec struct { | |
|
|
||
| // +optional | ||
| Replication *PostgresReplication `json:"replication,omitempty"` | ||
|
|
||
| // +optional | ||
| ReadReaplicas []ReadReplicaSpec `json:"readReaplicas,omitempty"` | ||
| } | ||
|
|
||
| type PostgresConfiguration struct { | ||
|
|
@@ -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"` | ||
| // PodPlacementPolicy is the reference of the podPlacementPolicy | ||
| // +kubebuilder:default={name:"default"} | ||
| // +optional | ||
| PodPlacementPolicy *core.LocalObjectReference `json:"podPlacementPolicy,omitempty"` | ||
| } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we need a field for podPlacementPolicy. needed for distributed stuffs
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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