title |
---|
Introduction |
HashiBox is a local environment to simulate a highly-available cloud with Consul, Vault, and Nomad.
It also installs Docker for running Nomad's jobs inside containers. It leverages Vagrant for virtualization, and Bolt for maintenance automation across nodes.
The goal is to provide a development setup where Nomad jobs can safely be tested against real-life environments as close as possible.
This repository simulates a region called us
in which there are 3 datacenters:
us-west-1
with IP address 192.168.x.10.us-west-2
with IP address 192.168.x.20.us-east-1
with IP address 192.168.x.30.
In each datacenter we install 2 nodes:
- One acting as a server for Consul, Nomad, and Vault with IP address 192.168.60.x.
- One acting as a client for Consul and Nomad with IP address 192.168.61.x. Docker is also installed for running Nomad jobs inside containers.
Here is a summary table of the infrastructure setup using the default Vagrantfile
and the default configuration:
Region | Datacenter | Agent's mode | IP address |
---|---|---|---|
us |
us-west-1 |
server | 192.168.60.10 |
us |
us-west-1 |
client | 192.168.61.10 |
us |
us-west-2 |
server | 192.168.60.20 |
us |
us-west-2 |
client | 192.168.61.20 |
us |
us-east-1 |
server | 192.168.60.30 |
us |
us-east-1 |
client | 192.168.61.30 |
You can clone the repository with:
$ git clone https://github.com/nunchistudio/hashibox
Before continuing and installing the setup, it's important to take a look at the directory structure to better understand how it works:
Vagrantfile
: This is the file to setup the required nodes using Vagrant. This also takes care of exposing the private network for each node with the IP addresses given earlier.Makefile
: This is mainly used to simplify the installation process.bolt.yaml
: Required file to leverage the Bolt command-line within this directory.inventory.yaml
: This file is used by Bolt and allows us to organize our nodes per groups so we can then run tasks on different groups of nodes such as every nodes acting asclients
, or every nodes in theus-west-1
datacenter.modules/
: This contains Bolt tasks and plans to execute on the remote nodes.uploads/
: This directory is used to upload files for each node, in each datacenter, for each region.us/
: Applied for theus
region._defaults/
: This directory contains the default configuration files that will be applied to all nodes present in theus
region.us-west-1/
: This directory contains the specific configuration files for theus-west-1
datacenter only.us-west-2/
: This directory contains the specific configuration files for theus-west-2
datacenter only.us-east-1/
: This directory contains the specific configuration files for theus-east-1
datacenter only.
Next: Installation