An example of a multi-cloud Docker Swarm on AWS and GCE. Uses Terraform and Ansible to bootstrap.
note: This set of scripts assumes that it's running in the default VPC for AWS, as well as using the default network in GCE. These things can be made configurable at some point. PRs welcome.
- Source AWS API keys with
source /path/to/awscreds.shorexport - Configure defaults in
variables.tfor override them with flags duringterraform apply - Plan the build with
terraform planand ensure it looks as expected - Build the infrastructure with
terraform apply - Once built, issue
cat swarm-inventoryto ensure master and workers are populated - Bootstrap the Swarm cluster with
ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -b -i swarm-inventory swarm.yml
- You can tear down the swarm cluster and leave the nodes for rebootstrapping with
ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -b -i swarm-inventory swarm-destroy.yml - Destroy all infrastructure with
terraform destroy