Trying to manually deploy and configure your load balancers in a dynamic infrastructure can be overwhelming. As you deploy and increase the scale of your microservices, your
load balancers will need a way to keep up with the IP addresses of your
application instances. Fortunately, Nomad (along with its powerful integration
with Consul), automates this process and works seamlessly with many popular load balancers such as NGINX, HAProxy, and Traefik.
NGINX Integration Using Template Stanza
Nomad uses the Consul Template tool in its template
stanza. This allows Nomad to populate values from Consul and Vault, in addition
to Nomad’s runtime environment variables.
Using the template stanza, Nomad can populate NGINX’s configuration with the IP
addresses of healthy service instances. Try out the integration with the following guide:
HAProxy Native Integration
HAProxy version 1.8+ (LTS) includes the server-template feature, which lets users specify placeholder backend servers to populate HAProxy’s load balancing pools. Server-template can use Consul as one of these backend servers, requesting SRV records from Consul DNS. Try out the following guide to learn
Traefik Native Integration with Consul Catalog Provider
Traefik can be configured to use the Consul Catalog Provider
and natively integrate with your Consul services while allowing you to use
route your traffic. Learn more with the following guide: