Running Consul Connect with Envoy on Linux Hosts
Deploying HashiCorp Consul Connect with an Envoy sidecar proxy creates an identity-aware service mesh without adding certificate handling or routing logic to each application. Consul issues short-lived identities, while Envoy enforces mutual TLS and exposes authorised upstream services through local listeners.
This walkthrough uses Linux virtual machines and systemd, which suits Australian organisations running a mix of AWS and VMware estates. Kubernetes deployments need the Consul-Kubernetes injector instead of the service-registration flow shown here.
Prepare Consul for the service mesh
Install a supported Consul release on each node, configure server and client roles, and enable the service mesh through agent configuration or a service_mesh entry. Use ACLs, HTTPS for the API, and TLS for server-to-server traffic; consul dev is suitable only for a disposable lab.
Australian teams commonly anchor workloads in AWS Sydney (ap-southeast-2) or Melbourne (ap-southeast-4), while some VMware estates remain on-premises. Keep the Consul server quorum within the primary region and plan cross-region recovery separately, avoiding latency from ordinary proxy calls between Australian cities.
Broader automation and HashiCorp examples from IT Diversified fit alongside this setup. Confirm the agent can reach Consul peers, resolve service names and accept xDS updates before registering workloads.
Define the application services
Give each application a stable service definition and attach a sidecar service. This example registers web-1, assumes the application is listening on loopback port 8080, and declares the api service as an upstream on local port 9090.
{
"service": {
"name": "web",
"id": "web-1",
"address": "10.20.1.15",
"port": 8080,
"connect": {
"sidecar_service": {
"proxy": {
"destination_service_name": "web",
"local_service_address": "127.0.0.1",
"local_service_port": 8080
},
"upstreams": [
{
"destination_name": "api",
"local_bind_address": "127.0.0.1",
"local_bind_port": 9090
}
]
}
}
}
}
Register the definition with consul services register web.json, adding CONSUL_HTTP_TOKEN when ACLs are enabled. Consul then starts the Envoy sidecar and supplies its listener, certificate, cluster and upstream configuration through xDS.
The api instance needs its own matching service definition and sidecar. The application never connects to an API IP address directly: it calls 127.0.0.1:9090, and Envoy selects a healthy registered instance before establishing the mTLS session.
Apply intentions and access controls
Consul intentions determine which service identities may call each other. They complement mTLS: a certificate proves identity, while an intention grants or denies that identity access to the destination.
{
"Kind": "service-intentions",
"Name": "api",
"Sources": [
{
"Name": "web",
"Action": "allow"
}
],
"Destinations": []
}
Apply the file with consul config write service-intentions/api api - < api-intentions.json. The source name must match the service identity used by the web proxy. Start with deny-by-default behaviour and add only explicit source-to-destination grants, such as web calling api. Use host firewalls or cloud network controls when port-level restrictions are required.
Under ACLs, issue a least-privilege token to each proxy identity. It needs access to its own service registration, the destination catalogue entry and relevant intentions. Scope policies to a Consul namespace or partition where used, and test token renewal before production rollout.
Validate the sidecar connection
Check consul services for the application and generated sidecar entries, then inspect the proxy configuration with consul connect proxy -id '<sidecar-service-id>'. Confirm the listener on 9090 and the API cluster are present rather than relying on an expected generated ID.
Point the web application at the local upstream port and exercise a real route. A local connection refused usually means the upstream block is missing; an HTTP 403 commonly indicates a denied intention, while 503 points to no healthy endpoint. TLS failures appear as connection resets or handshake errors.
Inspect the Envoy admin /ready endpoint on localhost port 19000 and review agent logs with journalctl -u consul. Record timestamps in UTC, but label Australian logs as AEST or AEDT so daylight-saving changes do not obscure incident timelines.
Troubleshoot and operate the mesh
Troubleshoot in layers: application configuration, local Envoy listener, Consul service discovery and intentions, then certificates and network policy. Inspect the rendered Envoy configuration first because it exposes listener addresses, TLS contexts, endpoint health and upstream clusters in one place.
Certificate failures commonly come from clock skew, an expired ACL token or blocked agent traffic. AWS security groups, NACLs and on-premises firewalls must permit service discovery and traffic between proxy instances. Restrict the Envoy admin interface to loopback or a dedicated management network.
For Australian operations, align service-mesh controls with the ACSC Essential Eight and applicable Privacy Act or APRA CPS 230 obligations. Canary Envoy versions in each operating Australian region, monitor handshake and upstream error counters, and retain logs in UTC. A healthy rollout is demonstrated by authorised mTLS traffic, deliberate intention denials and visible proxy health across the estate.