Browse the Repo

file-type-icon.circleci
file-type-icon_ci
file-type-icon_docs
file-type-iconexamples
file-type-iconnomad-consul-ami
file-type-iconnomad-consul-separate-cluster
file-type-iconnomad-examples-helper
file-type-iconroot-example
file-type-iconREADME.md
file-type-iconuser-data-client.sh
file-type-iconuser-data-server.sh
file-type-iconmodules
file-type-icontest
file-type-icon.gitignore
file-type-iconCODEOWNERS
file-type-iconCONTRIBUTING.md
file-type-iconLICENSE
file-type-iconNOTICE
file-type-iconREADME.md
file-type-iconcore-concepts.md
file-type-iconmain.tf
file-type-iconoutputs.tf
file-type-iconvariables.tf

Browse the Repo

file-type-icon.circleci
file-type-icon_ci
file-type-icon_docs
file-type-iconexamples
file-type-iconnomad-consul-ami
file-type-iconnomad-consul-separate-cluster
file-type-iconnomad-examples-helper
file-type-iconroot-example
file-type-iconREADME.md
file-type-iconuser-data-client.sh
file-type-iconuser-data-server.sh
file-type-iconmodules
file-type-icontest
file-type-icon.gitignore
file-type-iconCODEOWNERS
file-type-iconCONTRIBUTING.md
file-type-iconLICENSE
file-type-iconNOTICE
file-type-iconREADME.md
file-type-iconcore-concepts.md
file-type-iconmain.tf
file-type-iconoutputs.tf
file-type-iconvariables.tf
HashiCorp Nomad

HashiCorp Nomad

Deploy a Nomad cluster. Supports automatic bootstrapping, discovery of Consul servers, automatic recovery of failed servers.

Code Preview

Preview the Code

mobile file icon

README.md

down

Nomad and Consul Co-located Cluster Example

This folder shows an example of Terraform code to deploy a Nomad cluster co-located with a Consul cluster in AWS (if you want to run Nomad and Consul on separate clusters, see the nomad-consul-separate-cluster example instead). The cluster consists of two Auto Scaling Groups (ASGs): one with a small number of Nomad and Consul server nodes, which are responsible for being part of the consensus protocol, and one with a larger number of Nomad and Consul client nodes, which are used to run jobs:

Nomad architecture

You will need to create an Amazon Machine Image (AMI) that has Nomad and Consul installed, which you can do using the nomad-consul-ami example).

For more info on how the Nomad cluster works, check out the nomad-cluster documentation.

Quick start

To deploy a Nomad Cluster:

  1. git clone this repo to your computer.
  2. Optional: build a Nomad and Consul AMI. See the nomad-consul-ami example documentation for instructions. Make sure to note down the ID of the AMI.
  3. Install Terraform.
  4. Open variables.tf, set the environment variables specified at the top of the file, and fill in any other variables that don't have a default. If you built a custom AMI, put the AMI ID into the ami_id variable. Otherwise, one of our public example AMIs will be used by default. These AMIs are great for learning/experimenting, but are NOT recommended for production use.
  5. Run terraform init.
  6. Run terraform apply.
  7. Run the nomad-examples-helper.sh script to print out the IP addresses of the Nomad servers and some example commands you can run to interact with the cluster: ../nomad-examples-helper/nomad-examples-helper.sh.

Questions? Ask away.

We're here to talk about our services, answer any questions, give advice, or just to chat.

Ready to hand off the Gruntwork?