I'm a fan of k8s, but the rational of running DB's on it has always seemed specious to me.
I'm a fan of k8s, but the rational of running DB's on it has always seemed specious to me.
More like a trick poney, actually, because you'll have to teach it a lot about what to do with the several container lifetime hooks and states.
But hey, if you really need to run your postgres instances in kubernetes (which you don't because cloud postgres instances can be fully automated) kubernetes operators are like the world's expert in poney training working for you.
Your pet, your problem. one operator, world's problem.
What's the practical difference?
For example you can not have 2 postgres instances, each with their own locking mechanisms, check whether transactions are serializable, since they don’t know about the locks in the other instance.
This is very basic stuff so I wonder whether people who argue for treating databases like web servers lack basic training in this area.
The crux of my argument is: you probably don't need postgres in kubernetes on the cloud (just use the damn cloud api to manage your database), but if for any reason you want to, manage a postgres with kubernetes it's like managing it with systemd.
Way more involved, but doable. Great part is: just as vast majority of people don't write their own systemd units or postgres management scripts, they can use kubernetes operators and benefit from the open source knowledge and ecosystem.
I much prefer to be able to treat the database instances like cattle, while the conceptual "cluster" and its associated backups should be treated as a pet, as you said.