Load Balancer

40 views
Skip to first unread message

Sanat Pattanaik

unread,
Oct 13, 2023, 2:12:45 PM10/13/23
to Postgres Operator
Hi,
I installed postgres using the PGO in my Tanzu K8S cluster. It did not create a load balancer to access it externally. Is there any documentation around the configuration change to have a host url to access the db instance.

Thanks
Sanat

Sanat Pattanaik

unread,
Oct 16, 2023, 10:24:55 AM10/16/23
to Postgres Operator, Sanat Pattanaik
Added the following  to postgres.yaml and the loadbalancer was created
service:
type: LoadBalancer

Graham Boyle

unread,
Oct 16, 2023, 10:24:58 AM10/16/23
to Postgres Operator, Sanat Pattanaik

I'm assuming you have something like this configured:

  proxy:
    pgBouncer:
      port: 5432
      replicas: 1
      service:
        type: ClusterIP

Change the type to load balancer to make the IP available externally EG:
  proxy:
    pgBouncer:
      port: 5432
      replicas: 2
      service:
        type: LoadBalancer

If you check your services you should see the IP that is externally accessible
To make sure the the IP doesn't change if the Nodes are restarted you need to create a route to the service
Something like: You can you your internally accessible host name

spec:
  host: hippo15-pgo.your.k8s.domain.com
  to:
    kind: Service
    name: hippo15-ha
    weight: 100
  port:
    targetPort: postgres
  tls:
    termination: edge
  wildcardPolicy: None


Regards
G
Reply all
Reply to author
Forward
0 new messages