The infrastructure is a simple one based on Terraform and Ansible setting up Docker Swarm rather than more automated such as what Kubernetes could provide. Underyling nodes are managed via terraform. Everything is hosted in Digital Ocean, but the following could be adapted for most hosting providers.
- Terraform
- Ansible
- Terraform-inventory
- Create Terraform
terraform.tfvars
with the right data. - Use Terraform to generate droplets/nodes and a load balancer:
terraform init && terraform apply
- Use Ansible to provision the nodes using inventory generated from Terraform-inventory:
ansible-playbook --inventory-file=`which terraform-inventory` playbooks/swarm.yml
- Register the IP addresses from terraform output (if not using DO's DNS).
Steps 2-4 can be automated in run.sh