Dit is een oude revisie van het document!
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 virtual network interface with IP and connection to the desired VLAN.
For the persistent volume of the container we create a directory
/file add type=directory name=/usb1/persistent-volumes/haproxy/config-dir
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
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
/container/add remote-image=haproxy:latest interface=veth-haproxy root-dir=usb1/persistent-volumes/haproxy/root-dir mounts=haproxy name=haproxy /container/start haproxy