zalando / zalando/postgres-operator

Split Affinity for Pooler and Postgres Pods

Open
#2,551 1 comment 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
5.2k
Forks
1.1k
Avg merge
2d 16h
Merged PRs (30d)
3

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how affinity is configured for the pooler Deployment and Postgres StatefulSet, using issue #1600 for the scheduling context. The work is done when each deployment can use its own affinity policy, preserving required affinity for Postgres and preferred affinity for the pooler, with the relevant operator checks passing.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes, postgresql
Domain
databases, infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.