Skip to main content
HashiCorp Consul is a powerful service mesh solution that integrates seamlessly with Terraform and Kubernetes. In this guide, you’ll walk through installing Consul on your Kubernetes cluster to enable:
  • mTLS-encrypted pod-to-pod communication
  • Detailed visibility and troubleshooting for east–west traffic
  • Fine-grained access control between services
Consul’s official Helm chart simplifies installation and upgrades, making it an ideal choice for modern infrastructure.

Prerequisites

Ensure you have the following in place:

1. Add the HashiCorp Helm Repository

Register the official HashiCorp charts, search for the Consul chart, and update your local index:
Sample output:

2. Define Your Consul Configuration

Create a file named consul.yaml to customize your deployment. This example enables the UI, sidecar injection, and sets up two server replicas:

3. (Optional) Review Your Directory Structure

If you keep your configurations and helper scripts together, you might have:
In this lesson, we’ll run Helm commands manually rather than via the helper script.

4. Install Consul with Helm

Deploy Consul into your cluster using your custom consul.yaml:
Sample Helm output:

5. Verify the Deployment

Wait a minute for pods to initialize, then confirm they’re running:
List the services to find the consul-ui ClusterIP:

6. Access the Consul Web UI

Forward the UI port to your local machine:
Open your browser and navigate to:
You should now see the Consul web interface, confirming your service mesh is up and running.
Avoid exposing the Consul UI to the public internet. Use secure tunnels or VPNs for production environments.

Congratulations! You’ve successfully installed and accessed HashiCorp Consul as a service mesh on Kubernetes.

Watch Video