K8SPG-1057: Allow using etcd as patroni DCS#1647
Conversation
|
I will wait for the jira ticket to open the PR in the helm charts repo |
|
and another note - this is my first OSS contribute so be gentel 😄 |
egegunes
left a comment
There was a problem hiding this comment.
@yoav-katz the implementation looks good to me in general. but we definitely need an e2e test that deploys etcd and configures PerconaPGCluster to use it.
|
would love to see this merged! |
…erator into etcd-dcs
|
@egegunes Im not sure what caused this failure, my commit only touched unit test files so lint will pass😅 |
|
It seems to fail on cluster deletion due to timeout. I doubt it's something caused by these changes. I retriggered it. |
|
@mayankshah1607 |
… etcd in-place restore
…erator into etcd-dcs
commit: e84a9b1 |
| if cluster.UsesExternalDCS() { | ||
| return nil, nil | ||
| } |
There was a problem hiding this comment.
I think returning both nil here is going to confuse the caller
| // The pod-annotation watch that normally triggers reconciles for | ||
| // pending restarts never fires under non-Kubernetes DCS (Patroni | ||
| // doesn't write that annotation), so poll at roughly Patroni's | ||
| // own loop_wait cadence instead. See handlePatroniRestarts. | ||
| // cluster.Default() (called earlier in Reconcile) guarantees | ||
| // SyncPeriodSeconds is set. | ||
| requeue = time.Duration(*cluster.Spec.Patroni.SyncPeriodSeconds) * time.Second |
There was a problem hiding this comment.
please update PR description with this information that operator needs to reconcile periodically with external DCS so we don't forget documenting it
| if !requiresRestart(instance.Pods[0]) { | ||
| continue | ||
| } |
There was a problem hiding this comment.
have you tried this with more than 1 replica in an instance?
| meta.Labels = labels | ||
|
|
||
| job.ObjectMeta = meta | ||
| job.Spec = batchv1.JobSpec{ |
There was a problem hiding this comment.
I think we should let users configure tolerations and affinity for this job. since this is coupled with restores, maybe we can re-use restore tolerations/affinity
|
@yoav-katz friendly ping, we'll release v3.1.0 soon and it'd be great to include this |
|
Hopefully I will get to it this weekend |
CHANGE DESCRIPTION
Problem:
Patroni supports multiple DCS backends, but the operator hardcodes Kubernetes Endpoints as the only option. This blocks clusters on managed Kubernetes platforms where workloads cannot reach the control plane API.
Cause:
The kubernetes: stanza was hardcoded in the generated Patroni config with no mechanism to select a different backend.
Several other pieces of the operator also assumed k8s DCS: RBAC rules unconditionally granted Endpoints permissions, the primary service routed through Patroni-managed Endpoints objects, and pod role labels/annotations were expected to be set by Patroni itself (which only happens with k8s DCS).
Solution:
Add a spec.patroni.dcs field (type: kubernetes default, type: etcd alternative). The field is immutable after cluster creation, enforced by a CEL validation rule on the CRD.
When type: etcd, the operator:
The Kubernetes DCS path is unchanged.
CHECKLIST
Jira
Needs Doc) and QA (Needs QA)?Tests
Config/Logging/Testability