Forming a PostgreSQL cluster within Kubernetes
Dmitriy Paunin
1317

Nice article!

We have a kubernetes setup and are currently trying out multiple postgresql HA solutions (3 node) to find which one really works. I made some basic changes to your solution to suit our deployment “provisioner” needs. Instead of having 3 StatefulSets (for a 3 node setup), I created just one StatefulSet (with Adaptive Mode) with 3 replicas and changed the docker entry point to populate NODE_ID, NODE_NAME and other instance specific things for each replica. Pgpool sits in the front of this setup.

Failover works each time!

Now I don’t know if its because of some misconfiguration at my end, but this is what I see:

  • At times when the failed master comes up, it is not able to auto-detect the new master and assumes the role of master. Thus causing 2 masters in the setup.
  • When one instance goes down and does not come up beyond x seconds, Pgpool marks it as “down” but does not mark it as “up” when it finally comes up and is responsive
  • At times Pgpool does not show the correct master.

Your solution is by far the most promising and suitable for our setup. And I would really like it to work. Can you provide some pointers? I can share my config file snippets if needed.

Thanks,

Sudeep

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.