In order to run a HA K3S (3-node) cluster I need an HA external database (e.g. PostgreSQL). I have 2 Postgres Servers A and B running in streaming replication mode but I can only point K3S at the master A because only the master allows writes. If A dies or is booted or has a problem or whatever my cluster is down.
Can I install PGPool on both the above servers behind a Load Balancer (F5*) in such a way that if the master server A dies (is rebooted or in some other way disappears) the remaining PGPool automatically promotes the following server B to master? When server A starts it should then somehow know that it is no longer the master and, ideally become a readonly follower. K3S will always be pointed at the F5 load balancer.
[*] F5 will simply round-robin balance all traffic (reads and writes) to both PGPool endpoints and their job is to send writes (INSERT, UPDATE, DELETE etc) to the master server. F5 will poll the hosts and stop sending traffic to a host if it dies.