Even though this deployment runs on a single host, you may still want to use a load balancer for convenience.
The following ocnfiguration in /etc/haproxy/haproxy.cfg
work for me - BUT - replace the IP addresses with the IP addressess from the output of multipass list
. I found that using host names defined in /etc/hosts
does not work:
defaults
mode tcp
timeout client 10s
timeout connect 5s
timeout server 10s
frontend traefik_insecure
mode tcp
bind :9080
default_backend traefik_ingress_insecure
frontend traefik_secure
mode tcp
bind :9443
default_backend traefik_ingress_secure
backend traefik_ingress_insecure
mode tcp
balance leastconn
server s1 10.15.174.173:30524
server s2 10.15.174.177:30524
server s3 10.15.174.176:30524
server s4 10.15.174.89:30524
backend traefik_ingress_secure
mode tcp
balance leastconn
server s1 10.15.174.173:31479
server s2 10.15.174.177:31479
server s3 10.15.174.176:31479
server s4 10.15.174.89:31479
Restart the service:
sudo systemctl restart haproxy.service
From https://medium.com/better-programming/local-k3s-cluster-made-easy-with-multipass-108bf6ce577c