### Nomad Cluster

This project contains the terraform instruction that brings up a production
ready cluster for nomad. It installs: Nomad Server, Nomad Client, Consul Server,
Consul Client, Consul Template and nginx.

### Launching the Cluster

Make sure you have Hashicorp's Terraform installed on your machine. Terraform
is used to orchestrate the launch of the cluster, and run instructions on the
machine.

1. Create a PEM key: the pem key name need to be replaced in the configuration
   file (master.tf and client.tf).

2. Create an AWS access and secret keys, make sure those have permissions to
   launch instances on the cluster. When you have those keys, replace them in
   the configuration (master.tf, and client.tf). Look for: `access_key` and
   `secret_key`.

3. Launch the servers (`cd master; terraform apply`) then the clients
   (`cd clients; terraform apply`).

### Add Nomad Jobs

To get a job sample, you can either use the `nomad init` command line (which
creates a basic template with comments) or you can look at the `service.nomad`
in `examples/`.

Upload the job to one of the running master, then run:

> nomad run service.nomad

### Issues?

If an issue occurs while setting the cluster, just re-run the `terraform apply`,
it will terminate the instances that are not properly set, and will spawn new
ones.
