zalando / postgres-operator

Postgres operator creates and manages PostgreSQL clusters running in Kubernetes
https://postgres-operator.readthedocs.io/
MIT License
4.22k stars 968 forks source link

Setting - allowedSourceRanges: [] does not work #2385

Open thpang opened 1 year ago

thpang commented 1 year ago

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

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:

AUMakarov commented 7 months ago

By describe service (k8s): ... Events: Type Reason Age From Message


Normal DeletedLoadBalancer 12s service-controller Deleted load balancer Normal Type 7s service-controller ClusterIP -> LoadBalancer Normal Type 7s service-controller ClusterIP -> LoadBalancer Normal EnsuringLoadBalancer 0s (x2 over 7s) service-controller Ensuring load balancer Warning SyncLoadBalancerFailed 0s (x2 over 7s) service-controller Error syncing load balancer: failed to ensure load balancer: incorrect loadbalancer specification: loadbalancerSourceRanges are unsupported