The final element on the stack is HAProxy. Patroni uses this to redirect traffic to the primary read/write node in our PostgreSQL cluster. Technically, we don't strictly need this component since Patroni will operate without it. However, if we want the capability to always reach the primary node regardless of its location, then this recipe is essential.
This recipe will introduce HAProxy to act as a high-availability connection proxy for Patroni.