zalando / zalando/postgres-operator
PodDisruptionBudget's more flexible configuration
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? ghcr.io/zalando/postgres-operator:v1.13.0
- Where do you run it - cloud or metal? Kubernetes or OpenShift? AWS EKS, Metal (rke2, minikube)
- Are you running Postgres Operator in production? Yes
- Type of issue? Feature request
I feel that the podDisruptionBudget should be more flexible in its configuration, allowing to configure the pdb parameters as minAvailable and maxUnavailable, as currently you can only configure to enable the pdb (enable_pod_disruption_budget) and to include or not the master label in the selector (pdb_master_label_selector).
I understand the need to remove the master label from the selector, e.g. to allow node upgrades (we ourselves have had the same problem whenever we upgraded EKS). However, if you disable the master label, since you can't configure anything else in the PDB, you get a PDB that is not very useful. For example, for a case of 3 replicas, you would be left with a PDB that allowed 2 disruptions, which would lose quorum:
NAME MIN AVAILABLE MAX UNAVAILABLE ALLOWED DISRUPTIONS AGE
postgres-ghale-psql-cluster-pdb 1 N/A 2 10m
Wouldn't it be better to be able to configure the minAvailable and maxUnavailable parameters? In this way, by disabling the master label in PDB, you could configure a PDB with a maxUnavailable 2 for the case of 3 replicas, and you would be sure not to lose the quorum.
Maybe I'm misunderstanding something, or maybe removing the master label is intended to be only temporary, for example, while you upgrade, but this seems a bit weird IMO.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the configuration and PDB generation paths for enable_pod_disruption_budget and pdb_master_label_selector. Review the operator's existing tests around PodDisruptionBudgets, then define and test configurable minAvailable and maxUnavailable behavior, including the expected handling when both or neither is set.
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
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100