I have one host with HAProxy running as docker container using docker compose . I want to scale out our HAProxy horizontally to make it highly available across multiple hosts.
I read few tutorials with keepalived but that is done on the host & with being HAProxy server installed as a host & not in docker container .
Is it possible to deploy highly available HAProxy in a dockerized way ?
(I understand that i have a virtualized setup)
You can run a HAProxy and a Keepalived in a container with main process. Docker provide --privileged param, so Keepalived can get the VIP(Virtual IP) through this way in a container.
About how to run multiple processes in a container, you can refer to docs: multi-service-container
After you started Haproxy & Keepalived more than to nodes, VIP can drift between these nodes. With same haproxy.cfg, you can access HAProxy service with VIP. So that you can get the High-Avaliable HAProxy service.
About how to run HAProxy & Keepalived in a container, there is an image you can try it: docker haproxy-keepalived