zalando / postgres-operator

Postgres operator creates and manages PostgreSQL clusters running in Kubernetes
https://postgres-operator.readthedocs.io/
MIT License
4.35k stars 980 forks source link

Manually switch postgres master/replica #1695

Open SpikePy opened 2 years ago

SpikePy commented 2 years ago

I am running a kubernetes cluster with 2 postgresql instances. I found out that you can do a switchover via patronictl switchover or by changing the leader in the postgres-leader-configmap.

Which is the recommended way and why?

FxKu commented 2 years ago

I usually do it via patronictl switchover from inside the pod. postgres-leader-configmap sounds like something I would leave to Patroni to update.