Access HashiCorp-managed clusters
After creating a HashiCorp-managed cluster, HCP provides both public and private URLs that you can use to access your cluster. You can also generate an admin token to access your cluster through the HTTP API or the Consul UI.
Get access URL
HCP provides the URL to access the Consul UI or make API calls to the Consul server. To access the URL, complete the following steps:
- Sign in to the HCP Portal.
- Select the organization or project where you created the cluster you want to access.
- Click Consul.
- From the Consul Overview, click the cluster ID you want to deploy clients with.
- Click Access Consul.
HCP Consul provides a URL for the public address and a URL for the private address. The public address allows access from any location over the public internet. The public address is most suitable for testing, development, and debugging scenarios. The private address limits access to connected networks. In production scenarios, we recommend using only the private address.
Generate admin token
To authenticate access to a HashiCorp-managed cluster, HCP provides an admin token that gives you the unlimited privileges for interacting with your cluster. You can use this token to access the Consul UI, deploying client agents with the Consul API, or interact with Consul using the CLI.
To generate the admin token, complete the following steps:
- Sign in to the HCP Portal.
- Select the organization or project where you created the cluster you want to access.
- Click Consul.
- From the Consul Overview, click the cluster ID you want to deploy clients with.
- Click Access Consul and then Generate admin token.
HCP provides an admin token that you can copy and use to access the Consul cluster. You cannot access the admin token again after closing the window that contains it. If you lose the admin token, you must generate a new one.
Connect to the Consul HTTP API
To connect to the HTTP API for a HashiCorp-managed cluster, export the URL and token:
Next, run an API call to the desired endpoint. For example, the following command returns the trusted certificate authority (CA) root certificates for the HCP Consul cluster.
View the Consul UI
You can use the HCP interface to view the cluster's built-in Consul UI. To view the UI, complete the following steps:
- Open the access URL 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.