»Get Started with HCP Consul
In this page, we will cover the high level steps for getting started with HCP Consul. If you are looking for a step by step guide to help you get started, we recommend following this tutorial on our Learn page.
The goal of HCP Consul is to make the initial getting started process for secure, production-ready Consul servers simpler for all users. If you’re new to HCP Consul, or Consul in general, you might have some questions about how the setup process works and what you are responsible for. The following steps should guide you through the initial startup process.
Before we can get started using Consul, we need to create a Consul cluster. To do this, first log into the HashiCorp Cloud Platform using either your GitHub account, Okta SSO login, or email address. From this page, you can locate the option for Consul. It will show you any existing Consul clusters deployed within your organization. From there, select the button that says “Deploy Consul” which will bring you to the configuration screen. The options you will find there include:
- Cluster ID - A unique identifier for your cluster, e.g. hcp-consul-cluster. This value cannot be the same as any other active HCP Consul clusters.
- Tier - Our various options for HCP Consul.
- Development is for testing purposes
- Standard is for production workloads located in a single region
- Plus is for production workloads spanning multiple regions.
- Network - This is where you specify the HashiCorp Virtual Network (HVN) that you will be using. If you have not done so already, you can create one
- Network Accessibility - Enable the Consul UI to be accessible via a public endpoint, not recommended for production use cases.
- Cluster Size - The vCPU and GiB RAM configurations available, each size corresponds to a number of service instances (e.g. a Small cluster supports up to 500 service instances)
- Consul Version - The available versions of Consul, it is recommended that you use the default recommended version if you don’t require a specific version.
Once configured, you select create cluster and HCP will take care of the rest. Please note that cluster creation takes about 10 minutes to complete.
Following the creation of your HCP Consul server cluster, we now need to connect our HashiCorp Virtual Network (HVN) to an AWS Virtual Private Cloud (VPC). This must be done in order to complete the third step, deploying a Consul client. HVN connections can be completed one of two ways:
- Direct VPC Peering - Using this method, a user will directly connect the HVN to an AWS VPC. Connect requests can be initiated from the HCP UI or using the HCP Terraform Provider. Following the request initiation, users must accept it from their AWS account and configure their VPC routing table and security groups to communicate with HCP. For details on this process, please refer to this learn guide.
- Transit Gateway Attachment - If users are planning to connect multiple VPCs to their HCP Consul cluster, a Transit Gateway attachment may be the better option. The attachment, like direct peering connections, can be initiated via the UI or using the HCP Terraform provider, please refer to this learn guide for detailed steps.
Now that the cluster has been created and our HVN and VPCs have been connected, the final step is to deploy a Consul client. Consul leverages both servers and clients in order to discovery and connect services. The servers are what were deployed with your HCP Consul cluster and are fully managed by HashiCorp. Consul clients are deployed in the various runtime solutions operating in the VPCs that you connected. At current, Consul clients can be connected in the following environments:
- Amazon Elastic Kubernetes Service (EKS) - AWS’s managed Kubernetes service, Consul clients can be installed/connected to the HCP Consul cluster using Consul’s helm chart.
- Amazon EC2 - Consul supports containers or VMs. Please follow the installation instructions for the operating system of the EC2 instance that you are running.
- Amazon Elastic Container Service (ECS) - AWS’s native container orchestration platform. Use Terraform to complete the installation of Consul clients on ECS nodes.