Deploy a highly-available (HA) three-node Consul cluster on AWS using Jenkins, Docker, and Terraform
Code project repository for the post, Provision and Deploy a Consul Cluster on AWS, using Terraform, Docker, and Jenkins. Please read the post for more information and instructions on using this project’s code.
In a recent post, Distributed Service Configuration with Consul, Spring Cloud, and Docker, we built a Consul cluster using Docker swarm mode. The cluster was built locally, with VirtualBox. This architecture is fine for development and testing, but not for Production.
In this post, we will deploy a highly-available three-node Consul cluster to AWS. We will use Terraform to provision a series of Elastic Cloud Compute (EC2) instances. The instances will be built from a hybrid AMI, containing the new Docker Community Edition (CE). In a recent post, Baking AWS AMI with new Docker CE Using Packer, we provisioned an Ubuntu AMI with Docker CE. Finally, we will deploy Docker containers to each EC2 host, containing an instance of Consul server.