Vijaykumar Jain wrote: > I am just asking in a different thread so as to not derail the original > conversation. > What was the real need to have postgresql cluster running in kubernetes? > I have experience in apache mesos, and did some beginner tutorial in > kubernetes, but in my case those were good for stateless services. > For dbs, we used to have dedicated vms for postgresql clusters on lvm and > vmware. It was very rare that we lost a physical server beyond recovery, I think you may want to run Postgres in Kubernetes when your Postgres clusters are cattle, not pets. For example, if you create and tear down many Postgres clusters daily for testing or development purposes. Like, a dedicated test Postgres DB for each commit in your CI/CD system. If your database clusters are pets, I see no reason to run them in Kubernetes. Maybe someone will prove me wrong and name some reasons. > > Now with k8s, every time the server sneezes, the pods would get spawned > onto different servers that would result in a full resync unless volumes > could be moved. Not actually. The core of both Zalando's and CrunchyData's operators is Patroni which relies on Postgres' own physical replication. As soon as the master Pod dies, a standby will be promoted by Patroni, the failover process is really quick. You should setup some kind of anti-affinity so that the leader and the standby Pods should not end up on the same node though. At least I *hope* the operators work that way. > Since containers are now in a shared environment, and if it is mostly over > committed, then tuning of various params of a instance would be totally > different compared to what was it on a dedicated vm. Your other questions about shared resources in a Kubernetes cluster are very interesting for me too. I hope someone can reply. I feel that the degree of control you have over your Postgres cluster when it's running on VMs (EC2 instances etc) cannot be achieved in Kubernetes. [dd] > > Maybe just like ssd, hdd, postgresql community would come up with a cost > param to generate plans if run on k8s vs dedicated servers :). I think Postgres itself can neither know no care if it's running in a Pod. What tunables or cost params can you think of? -- Victor Sudakov VAS4-RIPE http://vas.tomsk.ru/ 2:5005/49@fidonet
Attachment:
signature.asc
Description: PGP signature