patroni:8008/master will return http status code 200 only if the node running as elected master
patroni:8008/replica will return http status code 200 if node running as replica.
And final missing bit is a automation of generation of haproxy.cfg - it could be done with confd: https://github.com/kelseyhightower/confd
And here is an example of template file: https://github.com/zalando/patroni/blob/master/extras/confd/...
should do the trick
patroni:8008/master will return http status code 200 only if the node running as elected master
patroni:8008/replica will return http status code 200 if node running as replica.
And final missing bit is a automation of generation of haproxy.cfg - it could be done with confd: https://github.com/kelseyhightower/confd
And here is an example of template file: https://github.com/zalando/patroni/blob/master/extras/confd/...