Create and Manage Clusters
You can use the HashiCorp Cloud Platform (HCP) to create Consul clusters. A cluster is a group of one or three Consul server agents.
Prerequisites
We recommend creating the following components before you create Consul clusters:
- A HashiCorp virtual network (HVN)
- A peering connection or transit gateway attachment
- Routes for directing network traffic between the HVN and a target connection
The procedure for creating and configuring these components is specific to the infrastructure environment. Refer to the specific instructions for your environment:
Create a Consul Cluster
- Sign in to the HCP Portal and select your organization.
- From the sidebar, click Consul.
- Click Create cluster.
- Select the provider of your infrastructure environment and then click Next.
- Select HCP UI Workflow and then click Next.
- Enter a name for the cluster in the Cluster ID field. The cluster ID is a unique identifier that cannot be used for other active HCP Consul clusters.
- Choose the HVN where you want to deploy your clusters. You should configure the HVN for the same environment where your Consul agents are deployed. If an appropriate HVN for your environment does not exist, click Create new network to create a new HVN.
- If you want to be able to access the Consul cluster UI from an external network, enable the Allow public connections from outside your selected network option. Enabling public access is less secure. We do not recommend enabling this option for production servers.
- Choose a cluster tier. Each tier enables a different set of Consul server features. Different tiers and features are available for different infrastructure environments. For more information, refer to Features Overview.
- Choose a size for the cluster. Clusters are measured by the number of virtual CPUs and amount of RAM per service instance. For example, a small cluster supports up to 500 service instances. For more information, refer to HCP Consul Pricing.
- Choose the Consul version for your server agents. If you do not require a specific version, we recommend choosing the default option, which is the latest release of Consul.
- Click Create cluster.
HCP then begins cluster creation. It takes about 10 minutes for the operation to finish. Wait until your cluster is created before connecting clusters and deploying agents.
Cluster Configuration Reference
There are several cluster configuration options:
Attribute | Description | Default |
---|---|---|
Cluster ID | A name that serves as a unique identifier for your cluster. This value cannot be the same as other active HCP Consul clusters. | consul-cluster |
Cluster size | Specifies the vCPU and GiB RAM configurations. Each size corresponds to a number of service instances. Extra small is only available on the development tier. | Small |
Cluster tier | Four tiers are available: Development: Lowest tier designed for testing purposes. Standard: Middle tier designed for production workloads located in a single region. Plus: Higher tier designed for production workloads spanning multiple regions. Premium: Highest tier designed for production workloads spanning multiple cloud providers. For more details, refer to cluster tiers. | Development |
Consul version | Specifies the Consul version deployed to the cluster. If your environment does not require a specific version, we recommend you use the default version. | Latest GA version |
Network | Specifies the HVN that contains the cluster. | Defaults to the first HVN listed in HCP. |
Network accessibility | Enables access to the Consul UI through a public endpoint. For production use cases, we recommend that you disable public accessibility. | Disabled |
View the Cluster’s Consul UI
If you followed the demo cluster creation instructions, you can use the HCP interface to view th. The quick start feature creates a cluster with a public address, which we do not recommend for production.
- Sign in to the HCP Portal and select your organization.
- From the sidebar, click Consul.
- Click on a cluster in the ID column.
- From the Access Consul menu, click Generate admin token.
- Copy the token, then click Close.
- From the Access Consul menu, click Public.
- Open the URL for the public address in your browser.
- Click Log in.
- Paste the admin token and then click Log in.
The Consul UI appears. The default page lists the services deployed to the cluster.
For more information about navigating the Consul UI and using Consul features, refer to the Consul documentation.
Edit a Cluster
You can change the Consul version and cluster size after you create the cluster. You may want to edit clusters as new versions of Consul become available or as your networking needs evolve. However, you cannot modify the cluster name, tier, or HVN after creating a cluster. You also cannot delete clusters that are part of a federated network.
HashiCorp automatically updates your Consul clusters to fix common vulnerabilities and exposures (CVE).
To learn how to upgrade your Consul version or cluster tier, refer to Upgrades.
Delete a Cluster
Important: When you delete a HCP Consul cluster, the snapshots associated with the cluster are also removed. You can’t recover snapshots after they are removed. If you intend to restore a cluster, use an API call to download the snapshot before you delete the cluster. When you restore it, the new cluster’s name must match the name of the deleted cluster.
You can delete clusters from HCP.
- Sign in to the HCP Portal and select your organization.
- From the sidebar, click Consul.
- From the ellipsis menu next to the cluster you want to delete, click Delete.
- To confirm, enter
DELETE
. Then click Delete.