This overview provides considerations when deploying load balancers in your infrastructure for performance and HA. While reading through these scenarios, you should evaluate what works best for your particular environment.
»Deploy load balancers in separate datacenters
Nomad allows you to configure which datacenter your node belongs to. Using this information in the job specification, you can control which datacenter you deploy your application into. You can use this technique to isolate your load balancers by deploying them to a distinct datacenter. This method may provide you the following advantages:
Isolation between submitting/modifying infrastructure-related jobs vs core applications.
The ability to deploy your load balancer as a system job to a well-defined, limited number of nodes dedicated to your infrastructure applications. This simplifies deployment while preventing the over-utilization of resources across the entire cluster.
»Use service scheduler with 1+ instances of your load balancer
While deploying your load balancer as a system job simplifies scheduling and guarantees your load balancer has been deployed to every client in your datacenter, this may result in over-utilization of your cluster resources. You may want to consider deploying your load balancer with the service scheduler and using a count with 1+ instances. Please note the following:
Your applications need to use service discovery to discover the load balancer instances in your cluster.
»Use auto scaling groups with load balancers
Configure the group of Nomad clients that are running your load balancer to be part of their own autoscaling group.
Configure these clients with metadata unique to their purpose.
Run the load balancer job constraining the deployment to the metadata you have configured on the clients.
The preceding steps ensure that if any nodes dedicated to running your load balancers go down, the necessary infrastructure is brought back up. Also, Nomad ensures the load balancer gets deployed to the correct nodes.
Note: Consider configuring Dynamic Scaling to automatically scale up the nodes dedicated to your load balancers based on metrics like CPU utilization, etc.
»Deploy a load balancer
Try one of the tutorials below to deploy a popular load balancer: