zalando / postgres-operator

Postgres operator creates and manages PostgreSQL clusters running in Kubernetes
https://postgres-operator.readthedocs.io/
MIT License
4.38k stars 980 forks source link

Split Affinity for Pooler and Postgres Pods #2551

Open antonmatsiuk opened 9 months ago

antonmatsiuk commented 9 months ago

Please, answer some short questions which should help us to understand your problem / question better?

As described in #1600 pooler deployment gets stuck in roll-out with requiredDuringSchedulingIgnoredDuringExecution affinity. The implemented and proposed solution is to use preferredDuringSchedulingIgnoredDuringExecution affinity both for pooler and postgres pods. However, this creates an unnecessary coupling between two different deployments which may have different SLAs, zone-redundancy requirements and roll-out strategies.

Since pooler is a Deployment and postgres is a StatefulSet the expectation is that postgres StatefulSet followsrequiredDuringSchedulingIgnoredDuringExecution to guarantee that Pods and related PVC are distributed across 3 availability zones. However, this affinity does not work for pooler Deployment for which preferredDuringSchedulingIgnoredDuringExecution affinity must be used to schedule pods in a cluster with Availability Zones.

Solution: decouple the affinity setting for Pooler from Postgres StatefulSet.

antonmatsiuk commented 7 months ago

any update on this?