- mTLS-encrypted pod-to-pod communication
- Detailed visibility and troubleshooting for east–west traffic
- Fine-grained access control between services
Prerequisites
Ensure you have the following in place:| Tool / Resource | Purpose |
|---|---|
| Kubernetes cluster (LKE, EKS, GKE, etc.) | Host your Consul service mesh |
| Helm (v3+) | Manage and deploy the Consul Helm chart |
kubectl | Interact with your cluster |
1. Add the HashiCorp Helm Repository
Register the official HashiCorp charts, search for the Consul chart, and update your local index:2. Define Your Consul Configuration
Create a file namedconsul.yaml to customize your deployment. This example enables the UI, sidecar injection, and sets up two server replicas:
| Configuration Key | Description |
|---|---|
global.name | Unique release name for your Consul deployment |
global.datacenter | Logical datacenter identifier |
server.replicas | Number of Consul server pods |
ui.enabled | Toggle the Consul web UI |
connectInject | Enable sidecar proxy injection by default |
controller.enabled | Deploys the Consul Kubernetes controller and CRDs |
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 customconsul.yaml:
5. Verify the Deployment
Wait a minute for pods to initialize, then confirm they’re running:consul-ui ClusterIP:
6. Access the Consul Web UI
Forward the UI port to your local machine: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.