Logo

dev-resources.site

for different kinds of informations.

Exposing replica nodes in Percona Operator for PostgreSQL

Published at
10/24/2024
Categories
kubernetes
postgres
operators
opensource
Author
spronin
Author
7 person written this
spronin
open
Exposing replica nodes in Percona Operator for PostgreSQL

This is a micro blog post about a feature that I failed to praise in Percona Operator for PostgreSQL - ability to expose replicas separately.

The problem is that when you connect to the PostgreSQL cluster through pgBouncer, it routes all you reads and writes to the primary.

Percona Operator for PostgreSQL - pgbouncer connection

So in that case the role pgBouncer plays here:

  1. Pool connections
  2. Provide single entry point to connect to
  3. In case of primary failure reroute quesries to the new primary

But we heard it a few times, that it is not good enough. Sometimes you want to have your application to scale reads and not hammer your primary.

Starting version 2.4.0 we allow users to expose replica nodes separately. It is happening by default for all clusters already. You can see -replicas service:

NAME                TYPE           CLUSTER-IP      EXTERNAL-IP    PORT(S)          AGE
cluster1-replicas   ClusterIP      10.118.234.58   <none> 
5432:31812/TCP   11h
Enter fullscreen mode Exit fullscreen mode

To change the service type, user should alter spec.expose section:

  expose:
...
  exposeReplicas:
    type: LoadBalancer
Enter fullscreen mode Exit fullscreen mode

With this exposure your application connection is going to look like this:

Percona Operator for PostgreSQL - exposing replicas

Percona offers various software options to run PostgreSQL:

And of course if you are looking for help, support, professional support - let our team know: https://www.percona.com/about/contact

operators Article's
30 articles in total
Favicon
Essential MySQL Operators and Their Applications
Favicon
Exposing replica nodes in Percona Operator for PostgreSQL
Favicon
It’s just β€˜,’ – The Comma Operator
Favicon
Operators, Conditionals and Inputs
Favicon
Practical Guide to Python Conditional Statements
Favicon
Python Operators Demystified
Favicon
SQL Operators Made Easy for Beginners
Favicon
First Steps in SQL Operators: A Beginner's Guide
Favicon
AND / OR operators, Short-Circuiting and Nullish Coalescing in Javascript
Favicon
From Zero to Hero: Disaster Recovery for PostgreSQL with Streaming Replication in Kubernetes
Favicon
Google Search Operators & Usage Tips
Favicon
Operators in C programming
Favicon
MySQL Operators – A Guide
Favicon
Annotations in Kubernetes Operator Design
Favicon
Exploring the unusual: JavaScript arrays and the 'in' operator
Favicon
Install Kubernetes Controllers via Operators - ARGO CD
Favicon
Mastering Advanced JavaScript Operators: The Ultimate Guide
Favicon
Operators in JavaScript: The Fundamentals
Favicon
Dart as, is, is! operatΓΆrleri
Favicon
Nullish Coalescing Operator
Favicon
Difference between ? and ?? in JavaScript/Typescript
Favicon
Ordering Event Bus Events with RxJS and concatMap
Favicon
Division, Floor Division and Modulus - Python Arithmetic Operators every beginner should know.
Favicon
Operators in Python
Favicon
Angular - Rxjs - Operator mergeAll
Favicon
Angular - Rxjs - Operator map
Favicon
Swift β€” 11 Useful Combine Operators You Need to Know
Favicon
Cloud Native CICD Pipelines in OpenShift
Favicon
Kubernetes Operators to realize the dream of Zero-Touch Ops
Favicon
JavaScript Basic - Variable, Data Types, Operators, Comparisons

Featured ones: