This topic describes how to federate Consul clusters in HCP.
Consul datacenter federation enables operators to extend their Consul environments by connecting multiple HashiCorp Cloud Platform (HCP) Consul clusters together within a region. Federation lowers the operational overhead of connecting applications across distinct regions and improves security. Server-to-server connectivity is automatically handled by the HCP platform.
Federation is a strategy for connecting datacenters and sharing services between them. HCP Consul also supports connecting services through cluster peering. In addition to the differences between WAN federation and cluster peering described in the Consul documentation, on HCP Consul it is not possible to federate HashiCorp-managed clusters hosted on AWS and Azure. It is also not possible to federate HCP-managed and self-managed clusters. Consider your network's existing topology and needs to help you determine the most appropriate strategy your network.
- Clusters within the HashiCorp virtual network (HVN) must have distinct network CIDR blocks to be federated.
- Only one cluster can be designated as the primary cluster. Clusters that you intend to designate as secondary must be added through federation.
- Standalone clusters cannot be added to an existing federation.
- By default, six Consul clusters are allowed in an HCP organization. As a result, one primary cluster and five secondary clusters are supported. You can request a higher limit by filing a support ticket.
Support for federation across regions or cloud providers is determined by the cluster tier of the Consul servers being federated. For more information, refer to cluster tiers.
On AWS, cluster peering and federation cannot be used on the same cluster concurrently.
- If you have not already done so, log into the HashiCorp Cloud Platform and click Consul under the Services sidebar menu.
- Either create a cluster or click on an existing cluster that you want to designate as the primary.
- Click Federation in the sidebar menu and click Create secondary.
- Configure the secondary cluster and click Create secondary. Refer to Create a Consul Cluster for information about cluster configuration options.
- Repeat the procedure to create additional subordinate clusters.
Tutorial: Complete the Federate Multiple HCP Consul clusters tutorial for additional guidance on enabling HCP Consul federation.