I have the following architecture for the PostgreSQL cluster:
Here, there are multiple clients that interacts with PostgreSQL pods via pgpool, the issue is, when the pod (could be pgpool or PostgreSQL pod) terminates (for multiple reasons) the client is getting impacts and have to recreate the connection. For example in this diagram, if postgresql-1 pod terminates then client-0 will have to recreate the connection with the cluster.
Is there a way in kubernetes to handle it so that connections to pgpool k8s service are load balanced/ recreated to other pods so that the clients do not see the switch over and are not impacted?
Please note these are TCP connections and not HTTP connections (which are stateless). Also, all the PostgreSQL pods are always in sync with remote_apply.
