Can nomad remove services from an AWS load balancer?

Similar to how nomad and consul integrate to add/remove services to traefik, can I do similar for an AWS load balancer wired up to go direct to my nomad clients?

I guess, the context for this, is that I’m fiddling with standing up elasticsearch as part of our cluster. Elasticsearch does its own proxying. traefik is redundant and just adds network latency. So, if nomad could smartly add/remove elasticserach “client” nodes from the AWS load balancer we could skip traefik all together.


I did think about this once but for scaled out tasks … that a post start task could “register” the “work” task’s IP:PORT into the ALB.

It remained only as a “thought experiment” though! :laughing:

similar to your idea @shantanugadgil – but slightly different …

we were afraid a post start task would fail for whatever reason, and have no repeatable recourse … so instead, we had a task that would auto-trigger, via the template block change_mode, when the nomadService "my-service" data changed … that way, we always had the latest service info – and could use it to feed an automation script that ::

  • retrieved latest AWS TG health
  • compared current AWS TG targets to nomad service data
  • registered active nomad targets
  • deregistered inactive nomad targets

it worked pretty well for us, and we had the confidence to run it at any time we deemed necessary … all that said, we ended up just proxying via traefik :stuck_out_tongue_winking_eye:

HTH @josh.m.sharpe

1 Like