Using AWS load balancer with nomad jobs

Getting started with Nomad. Looking for an automated way to connect/disconnect an AWS load balancer to jobs running under Nomad. That would solve the last piece of the load balancing/automation that I’m trying to achieve moving off of Kubernetes.

I found this old thread: https://groups.google.com/g/nomad-tool/c/OKZolbILOts But that was going on five years ago. Has any progress been made with this?

I’d rather not run my own load balancer, as that requires running another machine, monitoring load and bandwidth consumed on the LB, and spinning up more/bigger if needed, etc. It’s already a solved problem if I use the AWS load balancer. :slight_smile:

2 Likes

@joshua would starting the service at the correct port not make the ALB (I assume) register the instance in the target group?
(I too am interested if you do get this solved easily)

Hi @joshua and @shantanugadgil,

The current standard method is to use an AWS LB along with a load balancer running on a sub-set of your hosts acting as an internal router for services, utilising Consul service registrations.

That being said am I correct in assuming your request is for something Nomad/Consul equivalent of the Kubernetes aws-load-balancer-controller? If so, there is not anything I am aware of currently, but it is certainly an interesting idea.

Thanks,
jrasell and the Nomad team

@jrasell Based on my understanding of How it works - AWS LoadBalancer Controller yes, it would be nice to have something like this. The Fabio load balancer gets me part way there, but there are additional features that would be nice.

The other feature that I’m thinking about is this: when a nomad clients get too busy, it would make the needed cloud API calls to spin up additional resources, add them to the node cluster, increase job counts, etc. Likewise, when there is lack of activity, it would decrease job counts, drain jobs, terminate client nodes, etc.

As I’ve read and learned more about Nomad, I think Fabio and Autoscaling | Nomad by HashiCorp gets me most of the way there. I’ll just need a way to add the new nodes to the ALB once it spins up new nodes.