Nomad
Load balancer deployment considerations
Load balancers distribute incoming application traffic across multiple Nomad clients. This overview provides load balancer deployment considerations for performance and high availability in Nomad deployments that use Consul for service discovery.
Deploy load balancers as system jobs in a distinct datacenter
Configure your load balancer applications to use the system scheduler and deploy into a Nomad datacenter that has a well-defined, limited number of nodes dedicated to your infrastructure applications. This approach has the following advantages:
- Isolation between submitting or modifying infrastructure-related jobs versus core applications.
- Prevention of the over-utilization of resources across the entire cluster.
Refer to the job specification type block and datacenters
block for how to configure a
system job that deploys to a specific datacenter.
Deploy load balancers as service jobs with one or more instances
Configure your load balancers to use the service scheduler and to have one or more instances. This approach avoids overutilization of your cluster resources, but you should be aware of the following:
- Your applications need to use Consul service discovery to discover the load balancer instances in your cluster.
- You must manually adjust the job resources and instance count of your load balancers depending on traffic and utilization.
For configuration information, refer to the job specification
type,
resources, and
count blocks.
Deploy load balancers into cloud autoscaling groups
Use your cloud provider's autoscaling feature combined with Nomad's client metadata configuration option. This approach ensures load balancer availability. If any of your dedicated load balancer nodes go down, the cloud provider brings up the necessary infrastructure. Nomad then deploys the load balancers to the correct nodes.
The following is a high-level implementation overview:
Create an autoscaling group in your cloud provider.
Configure the the Nomad clients that are going to run your load balancer.
- Specify a
node_classso that Nomad logically groups these nodes together. - Add the cloud autoscaling group metadata as client
metadata.
- Specify a
Configure the load balancer job.
- Add a job
constraintfor thenode_class. - Add a constraint for the cloud autoscaling metadata. This constrains the deployment to only nodes that match the metadata.
- Add a job
Run the load balancer job.
Next steps
The following guides are available for specific load balancing applications:
Be aware that all of these load balancer guides require a Nomad installation configured to use Consul.
Additionally, the Manage external traffic with application load balancing tutorial teaches you how to deploy an Application Load Balancer on AWS to allow external internet traffic to your internally load-balanced applications running in Nomad.