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.
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 usepreferredDuringSchedulingIgnoredDuringExecution
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 follows
requiredDuringSchedulingIgnoredDuringExecution
to guarantee that Pods and related PVC are distributed across 3 availability zones. However, this affinity does not work for pooler Deployment for whichpreferredDuringSchedulingIgnoredDuringExecution
affinity must be used to schedule pods in a cluster with Availability Zones.Solution: decouple the affinity setting for Pooler from Postgres StatefulSet.