Re: Running PostgreSQL in Kubernetes?

Поиск
Список
Период
Сортировка
От Vijaykumar Jain
Тема Re: Running PostgreSQL in Kubernetes?
Дата
Msg-id CAM+6J9420v2X+Y86UvRq8KbYwu+2k3xOko6M+5gk7j9OOyuV-g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Running PostgreSQL in Kubernetes?  (Scott Ribe <scott_ribe@elevated-dev.com>)
Список pgsql-admin
Top posting, inline editing on phone is something I need to learn.

Many thanks for replying.

I was not aware complete infra is  now k8 managed. I have missed the k8 bus for sure.

Ofcourse we had problematic services (20 yrs abd still running) and worst, there was little monitoring around it, it's just the overloaded services exposed those problems. Hopefully it is now more stable via upgrading network devices and server patches. But I read ec2 instances crash a lot, maybe I generalized some blogs.

 -- movement is not required.
That makes it perfect, if they do not bounce on to server glitches. We had old servers, old raid controllers  and we had to no control on where the dbs would be deployed old, or new. hence we used vmware based migration for live movement.

We did not really have split brain, but zombie instances.
The instances used to detach from the service registry due to network outage, so new instances used to spin up to maintain that number of instance states in the registry,  but old instance could not commit suicide or kill itself, making it available for connections from some instances. It's when we introduced replication lag as a haproxy layer health check, we were able to get rid of that problem.

But in all, your answers make sense,
Any customized setup will require baby sitting initially,  but can be automated later once stable. 
But it looks like dba roles are old now. I'll have to upgrade myself to k8s to be surviving.

On Thu, Jul 29, 2021, 6:17 PM Scott Ribe <scott_ribe@elevated-dev.com> wrote:
> \On Jul 28, 2021, at 11:18 PM, Vijaykumar Jain <vijaykumarjain.github@gmail.com> wrote:
>
> What was the real need to have postgresql cluster running in kubernetes?

When you have everything else running in K8s, it's awkward to keep around a cluster of VMs just for your db--and running on dedicated hardware has its own tradeoffs.

> 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.

You either have shared network volumes (persistent volume claims in K8s terminology), in which case the migrated server re-mounts the same volume. Or you can use local storage in which case the servers are bound to specific nodes with that storage and don't migrate (you have to manage this a bit manually, and it's a tradeoff for likely higher-performing storage).

Also, what makes you think the server will "sneeze" often? I cannot remember the last time postgres quit unexpectedly.

> 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.

We don't find params to be different, but we are not really over-committed.

> Noisy neighbour's, a typical heavy activity like a bot attack on some services, which do not touch the db that is on the same server will have a serious impact due to shortage of resources.

This is not really different than VMs. You either are able to manage this reasonably, or you need dedicated hardware.

> in our case dns was under huge stress due to constant bouncing of services and discovery compared to original monoliths but were not tuned to handle that amount of changes and suffered stale cache lookups. For apps it would be OK, as they implement circuit breakers , but intra pg setup for barman or logical replication or pgbackrest would suffer a longer outage ?

You needed to fix your services. If your DNS is overloaded because your apps are moving so much, then something is terribly, terribly wrong. Any way, your postgres instances certainly should not be moving, so stale lookups should not be a problem, even in such a circumstance.

> Lastly, shared resources resulting in a poor query plan, like slow vacuuming may degrade the db.

Shared resources can slow things down, but I have no experience of that affecting what the appropriate query plan should be.

> Now, I have 0 exp in kubernetes, but I tried to understand the basics and found most of then similar to apache mesos. My use case was dbs grow and they grow really fast so they cannot be the same as immutable containers , but idk. Like when in need of a increased memory, it was OK to have do that for a vm and reboot, but for a pod, there is a risk of deployment and moving the instance on another server ? Or else all the  pods that server would get bounced?

As discussed above, movement of pods is not the problem you think it is. Network volumes, no problem moving; local storage, can't move.

В списке pgsql-admin по дате отправления:

Предыдущее
От: Scott Ribe
Дата:
Сообщение: Re: Running PostgreSQL in Kubernetes?
Следующее
От: Jayson Hreczuck
Дата:
Сообщение: Logical replication issue