Patroni is widely used for automatic failover, at least where you don't want a possibility of a split brain.