r/devops 1d ago

Troubleshooting Volatile Postgres cluster

Hi, I'm trying to setup a basic ha postgres cluster using the Spilos images in a docker swarm setup, but every few days the thing crumbles down with DNS resolution issues, timeouts, wal and etcd records corruption, I don't have the money to rely on an hosted solution rn, so has anybody run into these problems and solved them?. This makes me understand why the DBA role exists, but it is so frustrating and absurd that it is not a solved problem for something that feels so relatively trivial to setup in mariadb with galera.

2 Upvotes

6 comments sorted by

View all comments

1

u/mixxor1337 1d ago edited 1d ago

It is, just have a Look at k8s + cnpg operator

1

u/daved3464 1d ago

Lol, not really biting the bullet on the k8s mastery, that's why I clarified I'm using docker swarm. Using k8s would be overkill for my use case rn

0

u/Forward-Outside-9911 Linux Sysadmin 1d ago

It’s really not once you try it.

Once the cluster is setup (easy as pie with Talos), install the CNPG operator, you just create a yaml file with options for CNPG, then kubectl apply. Done.

Obviously it can get more “advanced” if you want it to be, fully GitOps, more moving parts. But Kubernetes has made it so easy for me to deploy multiple apps and DBs.

2

u/mixxor1337 1d ago

yeah, exactly this. It Just feels Like Magic... also the operational Overhead IS reduced, If but only if you understnad k8s.