We have three (3) clustered Postgres servers with an endpoint on each at Port 9201 that responds with the word master in the TCP response if that server is the Primary in the cluster
telnet fred 9201 will responds with:
HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 56
<html><body>PostgreSQL master is running.</body></html>
Based on which instance responds as master we would like to direct all traffic to the k8s cluster that is closest to the master
we have postgres databases in three data centers fred barney and bambam
if fred responds with master then we would like Big-IP to direct all trafffic to fred.k8s.internal
likewise barney responds with master direct all traffic to barney.k8s.internal
Our team is struggling with how to implement this any suggestions. We can do this using either http response or tcp response both are valid.
Any insight would be appreciated