OPNsense Forum

Archive => 21.1 Legacy Series => Topic started by: Goldorak92 on January 16, 2021, 08:26:02 pm

Title: Dns load balancing
Post by: Goldorak92 on January 16, 2021, 08:26:02 pm
Hi everyone,
I have a little question... I'm using unbound dns and Haproxy for all my stuff.
I'm publishing services on a swarm cluster.
Some services are available through Haproxy, but I'm thinking about a dns load balancing service: not publishing the service trough haproxy public service (front public port de number), but through a dns load balancing service which is able to serve all ports...
Is there a service/plugin for that on Opnsense?
Regards,
Goldorak92
Title: Re: Dns load balancing
Post by: testo_cz on January 27, 2021, 09:48:20 am
Hi

I run a swarm of nginx'es that aims production....so interested in general.

I thought external load balancer for swam only does balancing of the specific service e.g. http on TCP/8080 ?
Based on
https://docs.docker.com/engine/swarm/ingress/
... and works if the swarm service runs in global network mode.

Do you have an idea how to make it better/smarter please ?

Thanks
T.
Title: Re: Dns load balancing
Post by: Goldorak92 on January 27, 2021, 10:16:45 am
Hi,

That's my main problem also !
I have 3 swarm managers, so any traffic must be load balanced between those 3 managers.
So, for each service exposed on the swarm, I have:
- a dns entrie to resolve the service (ie: wordpress.local.domain), which points to a HAproxy
- on the HAproxy, for each service:
  - a public front (ie: 443)
  - a rule (ie: wordpress.local.domain)
  - a backend (ie: wordpress) which contains 3 "real" servers: the 3 swarm managers + the port of wordpress in the swarm

This is not my favorite solution, and that why I'm asking about a DNS load-balancing service:
- a dns entrie for wordpress.local.domain, and 3 possibilities to resolve: the 3 swarm managers's IP

Goldorak92
Title: Re: Dns load balancing
Post by: Wirehead on January 28, 2021, 09:05:27 am
DNS load balancing will cause slow-downs when a node is down. The HA-proxy solution with health check is better.
Title: Re: Dns load balancing
Post by: Goldorak92 on January 28, 2021, 09:28:17 am
Ok, thanks for your feedback @Wirehead