====== HA-Proxy on RouterOS7 ====== ===== prerequisites ===== you need:\\ [[installatie_handleidingen:mikrotik:usb-disk|an external disk on the USB port]]\\ [[installatie_handleidingen:mikrotik:containers-plugin| the containers plugin on RouterOS7]]\\ ===== network connections ===== There are several ways to connect the HA-Proxy container to the network, here we chose to give it its own IP.\\ follow the instructions to create a [[installatie_handleidingen:mikrotik:virtual-container-network|virtual network interface]] with IP and connection to the desired VLAN. ===== Persistent volumes location ===== For the persistent volume of the container we create a directory /file add type=directory name=/usb1/persistent-volumes/haproxy/config-dir ===== configuration file ===== Start by creating the config file on your workstation, ''vi haproxy.cfg'', add the following content for a test to the website at 10.100.10.103 global daemon maxconn 256 defaults mode http timeout connect 5s timeout client 50s timeout server 50s frontend http_in bind *:80 default_backend web_servers backend web_servers balance roundrobin server srv1 10.100.10.103:80 check upload this config file to the preveously crated location. scp haproxy.cfg styx:/usb1/persistent-volumes/haproxy/config-dir ===== set container mount ===== Now set the volume with the config file as a persistent volume mount in the container: /container/mounts add name=HAPROXY_CONF dst=/usr/local/etc/haproxy src=/usb1/persistent-volumes/haproxy/config-dir ===== deploy the container ===== /container add remote-image=library/haproxy:latest interface=veth-haproxy root-dir=usb1/persistent-volumes/haproxy/root-dir mounts=HAPROXY_CONF name=haproxy zoek het nummer van de containerdefinitie op: ''/container/print'' en start dat nummer (in ons geval 0) /container start number=0