zalando / zalando/postgres-operator
Setting - allowedSourceRanges: [] does not work
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.9.0
- Where do you run it - cloud or metal? Kubernetes or OpenShift? metal - OSS Upstream Kubernetes
- Are you running Postgres Operator in production? no
- Type of issue? Bug report
The services being created to not honor the empty list when assigned to allowedSourceRanges
This causes issues on bare metal systems that do not handle the loadBalancerSourceRanges entry in the service manifest.
If I set the following:
allowedSourceRanges: []
It is always replaced by:
loadBalancerSourceRanges:
- 127.0.0.1/32
in the service for the database
Here is the yaml being applied:
apiVersion: acid.zalan.do/v1
kind: postgresql
metadata:
namespace: "zalando-cluster-default"
name: "zalando-cluster-default-db"
spec:
teamId: "sas"
enableMasterLoadBalancer: True
enableReplicaLoadBalancer: False
enableConnectionPooler: False
enableReplicaConnectionPooler: False
enableMasterPoolerLoadBalancer: False
enableReplicaPoolerLoadBalancer: False
numberOfInstances: 1
allowedSourceRanges: []
postgresql:
version: "15"
parameters: # Expert section
max_prepared_transactions: "1024"
max_connections: "1024"
log_statement: "all"
volume:
size: "50Gi"
storageClass: "default"
Some general remarks when posting a bug report:
- Please, check the operator, pod (Patroni) and postgresql logs first. When copy-pasting many log lines please do it in a separate GitHub gist together with your Postgres CRD and configuration manifest.
- If you feel this issue might be more related to the Spilo docker image or Patroni, consider opening issues in the respective repos.
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
The payload names no files or tests; start by reproducing the issue with the provided PostgreSQL manifest and search the operator for allowedSourceRanges and loadBalancerSourceRanges handling. Done means an explicitly empty allowedSourceRanges value is preserved without adding 127.0.0.1/32 to the generated database service.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes, postgresql
- Domain
- databases, infrastructure
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100