Load balancing in Nomad

I am working through the tutorial over at Load Balancing with Traefik | Nomad - HashiCorp Learn on a freshly installed nomad cluster with 3 server (HA) and 2 client nodes. The server nodes run Nomad and Consul in server mode, the client nodes run Nomad and Consul in client mode.

The tutorial is working fine expect for the fact that the load balancing part is not really working:

  1. I can only access the traefik dashboard when I open it through the IP address of the client where traefik actually got deployed to (http://<Your-Traefik-IP-address>:8081) but not through the other client’s ip. Therefore I always need to know on which worker node traefik got deployed to.

  2. I can only access the backend services that are running on the same client as traefik (curl http://traefik.service.consul:8080/myapp) but not the same services running on the other client.

What am I missing in my configuration to get load balancing working? I have documented my cluster creation steps on github.

Hi @davosian1,

Thanks for using Nomad! This project looks awesome!!! And I love how it’s already helping the community. Thanks for choosing to learn in public!

I went looking around that repo and a couple of things stuck out to me.

  1. Your traefik job has type = "system" while the tutorial has type="service". Have you looked in Consul to see if a service is getting registered for the job? I’d start here.
  2. You are setting the traefik image to traefik:v2.5 but the tutorial uses traefik:v2.2. It’s possible the configuration has changed between versions, so maybe that’s a thing to look into?
  • Derek

Hi @DerekStrickland,

thanks a lot for checking my setup and your suggestions.

I actually tried them both already, sticking to the exact tutorial code (type service and using traefik:v2.2) and only after I was not successful, I went into testing different options. Using type system works for making traefik available on all node IPs, but it is actually cheating because this gives me one instance running on every node, so no routing needed from one node to another.

I am still having this issue, however I think I know the reason for it. It is probably caused by the same issue I am discussing over in this thread: Internal routing problem - #3 by davosian1. Unfortunately, I have not found the solution for it yet, but I am pretty sure it comes down to a small tweak in the network behavior for either Consul or Nomad. Any ideas are welcome :wink:

Ah ok. Well I already replied over there, so here’s hoping we get a 2-for-1 deal :slight_smile:

Your reply overthere at least feels like a 2-for-1 deal. Thank you :slight_smile: