Terraform to setup a consul cluster interacting with a nomad cluster
Terraform to setup a consul and nomad cluster by building the number of servers and clients specified. It wraps them around a firewall that can only be accesses via a bastion host (ssh) and a load balancer (http) Uses digital ocean as a provider to create the droplets needed. Sets up Vault to store secrets
Now also uses Consul Connect as a sidecar allocation to interact with other services
It starts nomad and consul as a service and automatically connects all nodes in the cluster
do_token
- api token for digital ocean which can be found in your DigitalOcean Account under "API"ssh_fingerprint
- the ssh fingerprint to use to connect to your newly created dropletsbastion_host_id
- the droplet id of the bastion host serverserver_count
- number of server droplets to createclient_count
- number of client droplets to createserver_count
- number of server droplets to createclient_count
- number of client droplets to createconsul_server_ip
- a consul server ipall_server_ids
- ids of all servers (droplets)all_server_ids
- ids of all servers (droplets)load_balancer_id
- the id of the digital ocean load balancerbastion_id
- the droplet id of the bastion hostScripts for installing required software in newly created droplets
install_consul.sh client|server ${self.ipv4_address_private} ${var.consul_server_ip}
install_nomad.sh client|server
install_vault.sh server
eval `ssh-agent -s`
ssh-add ~/.ssh/id_rsa
(add your private key to the ssh agent which corresponds to the ssh_fingerprint)terraform init
terraform plan
terraform apply