Configure your load balancer to distinguish between Write (Primary) and Read (Replica) traffic using Patroni's health endpoints. haproxy
listen postgres_primary bind *:5000 option httpchk GET /primary # 200 OK only from the current leader http-check expect status 200 server pg-node1 10.0.0.1:5432 check port 8008 server pg-node2 10.0.0.2:5432 check port 8008
