postgres-operator icon indicating copy to clipboard operation
postgres-operator copied to clipboard

Split Affinity for Pooler and Postgres Pods

Open antonmatsiuk opened this issue 1 year ago • 1 comments

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

  • Which image of the operator are you using?: registry.opensource.zalan.do/acid/postgres-operator:v1.10.1
  • Where do you run it - cloud or metal? Kubernetes or OpenShift?: AWS EKS, Azure AKS
  • Are you running Postgres Operator in production?: yes
  • Type of issue?: feature request

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 avatar Feb 22 '24 08:02 antonmatsiuk

any update on this?

antonmatsiuk avatar Apr 23 '24 14:04 antonmatsiuk