top | item 39809111

Ask HN: Best way to set up self-managed Postgres clusters?

26 points| samokhvalov | 1 year ago

Imagine you need to set up 100 Postgres clusters on Linux machines – self-managed, not RDS or CloudSQL or Azure or anything.

What's the best path in YOUR opinion?

1) apt/yum/... install

2) docker / docker-compose

3) kubernetes

16 comments

order

throwaway38375|1 year ago

There's no amount of money you could pay me to do this with Kubernetes. Like, you could offer me double my salary, and I'd laugh.

The only answer that makes any sense here is Ansible.

Arguments:

Way simpler

Can fall back to using plain SSH if things goes really wrong

No vendor lock in

One less bit of technology in the mix to go wrong

Very boring, which means very reliable

aristofun|1 year ago

What’s wrong with wrapping all in docker compose? Delivered to hosts by Ansible

paulryanrogers|1 year ago

Do they need to interconnect, or are they all standalone?

How big are these instances expected to get for the next few years?

OLTP, OLAP, warehouse, or a combo?

What's your budget?

What is your team most familiar with?

Will they be publicly exposed for shared hosting? Or behind a VPN/VPC serving only your employer?

Has anyone had a good time using Docker for something like this? (I haven't but the paravirt persistence may have gotten better?)

west0n|1 year ago

You may try kubeblocks(kubeblocks.io), a database control plane that can run almost any database on K8s.

rad_gruchalski|1 year ago

Clusters? So with replication, leader election, load balancing, whole shebang? Kubernetes, with the help of one of the battle tested operators.

samokhvalov|1 year ago

Yes

But why? Patroni is great for HA and it doesn't require k8s.

notadeveloper|1 year ago

Sorry but do you mean nodes or clusters? Anyway at this scale you are definitely looking into managed services from cloud providers or using Kubernetes. 1 and 2 is not an option because of the maintenance burden. Rolling out upgrades and resource allocation is going to be very hard without Kubernetes.

samokhvalov|1 year ago

Clusters with HA, backups and so on

k8svet|1 year ago

(after clicking through context...) There's no amount of money you could pay me to do this with Ansible. Like, you could offer me double my salary, and I'd laugh.

The only answer that makes any sense here is Kubernetes.

bravetraveler|1 year ago

So... Ansible isn't the thing hosting the thing. It talks to APIs; K8s is one of many it can handle!

This reads like a brazen misunderstanding/misrepresentation of Ansible.

Like... imagine the position of Terraform, a Kubernetes darling, and that's it.

I could especially see Ansible being used when not buying toy clusters, but building your own. I don't know how useful CRUD on the objects like deployments would be. Enough to do the job.

Point being, Kubernetes doesn't exclude Ansible in the slightest, whatsoever.

This was just enough for me to post... they aren't mutually exclusive. It's yet another layer of yaml to throw at the declaration problem.

Where/what/how is entirely up to the user. I'll take your money and then move on to the next thing to manage