HashiCorp Consul
Consul is a service networking tool from HashiCorp. It keeps a live catalog of the services running across your machines and clouds, hands out their healthy addresses through DNS or an API, and can encrypt and authorize the traffic between them as a service mesh.
itCloud native tools and technologies | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic — HashiCorp Consul
Consul is a service catalog with opinions. It keeps a live, health-checked list of every service in your infrastructure and hands it out through DNS, an HTTP API, or a fleet of proxies. That is the whole product; the rest is configuration.
The problem it replaced was a spreadsheet of IP addresses. Before tools like this, "where does the payment service live" lived in someone's config file, someone's wiki page, and someone's memory, all of which disagreed and one of which was on vacation. Consul made that question a DNS lookup: web.service.consul returns the machines currently running the web service and actually healthy. The actually is doing heavy lifting, and it is enforced by health checks: probes that continuously interrogate each service. No check, no trust. A service that registered and then fell over stops being handed out within seconds.
Three ideas carry everything else.
Agents. Consul is a daemon you run everywhere. Most are clients, lightweight and one per machine, that run checks and answer local queries. A few are servers, which hold the real state and elect a leader using Raft, the same consensus algorithm Kubernetes uses for its own brain. Three servers tolerate one dying. Five tolerate two. More than that is paying latency for vanity.
The proxy fleet. Turn on the service mesh and Consul puts a small proxy, usually Envoy, beside every service. Your application talks to localhost; the proxy handles the rest, wrapping every connection in mutual TLS so services authenticate by identity rather than by network position. Intentions, the mesh's permission rules, read like sentences: web may call api, web may not call admin. Rules follow the services when they move, which IP firewalls never manage to do.
Datacenters are a latency boundary. Gossip, the protocol agents use to gossip about each other, needs round-trips under about fifty milliseconds. You cannot stretch one Consul datacenter across an ocean, and you should not try. You run several and connect them with federation or peering, which sounds like jargon but is really just "one big family" versus "pen pals with a signed introduction letter".
One thing surprises everyone: Consul is not secure by default. Freshly installed, it is a comprehensive map of your infrastructure with the access controls turned off, which is a gift to anyone on your network with curious intentions. Every serious deployment adds encryption, access tokens, and mesh rules, and the docs are refreshingly blunt about it.
What Consul will not do: run your applications, cache hot data at Redis speeds, or improve a single modern Kubernetes cluster where the ecosystem's own tools already fit. Its habitat is the mixed estate, VMs beside Kubernetes beside bare metal, where one control plane beats four half-solutions.
If you read nothing else: the Cheatsheet tab holds the ports, commands, and check types you will want on a screen during an incident. The Landscape tab shows what else lives in this neighborhood. And the Reference tab is the ordered walk into HashiCorp's own documentation, which is, credit where due, excellent.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://developer.hashicorp.com/consul/docs
Supports
- Consul is a service networking platform providing service discovery, service mesh, traffic management, and automated network infrastructure updates
- Supported runtimes include VMs, Kubernetes, Nomad, Docker, ECS, Lambda, and OpenShift
- Use-case areas: API gateway, configuration management, DNS, service discovery, service mesh
- https://developer.hashicorp.com/consul/docs/intro
Supports
- Register/query/secure workflow as the core Consul workflow
- The catalog as the runtime source of truth for services and addresses
- DNS interface as identity-based discovery for healthy services
- mTLS and intentions for zero-trust service-to-service security without application changes
- Consul-Terraform-Sync automating network infrastructure device updates
- L7 traffic management supporting canary, A/B, blue/green deployments
- Community edition free; Consul Enterprise adds governance and scale capabilities
- https://developer.hashicorp.com/consul/docs/architecture
Supports
- Control plane maintains the central registry; data plane carries application data
- Raft index persisted with the write-ahead log (WAL) LogStore backend in the data directory
- Network coordinates computed from the Serf library estimate RTT between nodes
- https://developer.hashicorp.com/consul/docs/architecture/control-plane
Supports
- Datacenter as the smallest unit of Consul infrastructure
- Production recommendation of three or five server agents
- Server agents store all state; leader processes queries and transactions; followers forward requests
- Raft consensus on port 8300
- Client agents use RPC to servers on port 8300; recommendation of max 5,000 client agents per datacenter
- LAN gossip pool on port 8301 (UDP, TCP fallback)
- WAN federation with a primary datacenter holding authoritative ACL and mesh information
- WAN gossip pool on port 8302
- Cluster peering connects independent clusters via token exchange
- Consul dataplanes deploy Envoy proxies without client agents
- https://developer.hashicorp.com/consul/docs/architecture/data-plane
Supports
- Consul process does not run in the data plane
- Sidecar proxies handle all incoming and outgoing service traffic
- Envoy native support and Envoy terminology for upstream/downstream
- Four gateway kinds: API gateway, ingress gateway (deprecated), terminating gateway, mesh gateway
- https://developer.hashicorp.com/consul/docs/architecture/control-plane/dataplane
Supports
- Consul dataplane is a lightweight process managing Envoy proxies, removing client agents on Kubernetes/ECS
- Dataplanes connect to servers over gRPC TLS
- https://developer.hashicorp.com/consul/docs/concept/gossip
Supports
- LAN gossip pool required, port 8301; WAN gossip pool port 8302
- Serf library provides gossip communication and membership
- Gossip encryption key and consul keyring rotation
- Lifeguard enhancements for nodes under CPU/network exhaustion
- https://developer.hashicorp.com/consul/docs/concept/consensus
Supports
- Raft concepts: log entries, Raft index, peer set, quorum (N/2)+1
- Follower/candidate/leader states and elections
- Quorum loss makes the cluster unavailable for writes
- Quorum table: 3 servers tolerate 1 failure, 5 tolerate 2
- Recommendations of 3 or 5 servers; single-server datacenters for development only
- Writes block until committed and applied
- https://developer.hashicorp.com/consul/docs/concept/catalog
Supports
- Catalog fields (ID, node, address, tagged addresses, datacenter, service, health checks)
- Catalog API records user-defined and Consul-computed information
- https://developer.hashicorp.com/consul/docs/concept/consistency
Supports
- Anti-entropy mechanism reconciling agent local state with the catalog
- Agent state treated as authoritative
- Periodic sync intervals scale with cluster size (1 minute for 1-128 nodes)
- https://developer.hashicorp.com/consul/docs/concept/reliability
Supports
- Quorum size and fault tolerance table (3 servers tolerate 1, 5 tolerate 2)
- Single server agent datacenters restricted to development
- Diminishing returns as quorum size grows
- https://developer.hashicorp.com/consul/docs/fundamentals/agent
Supports
- Agent as long-running daemon; server and client modes
- Agent lifecycle: start, join, gossip, replication
- Failed versus left node states and their service registration consequences
- Reaping dead nodes after 72 hours
- Gossip latency requirements: average RTT <= 50ms, 99% <= 100ms
- consul agent -dev for development, never production
- Configuration loading in lexical order with merging; consul reload; reloadable settings list
- /etc/consul.d configuration directory convention
- retry_join for automated joining
- https://developer.hashicorp.com/consul/docs/fundamentals/service
Supports
- Service definition structure (name, id, port, tags, meta, checks, connect)
- HCL and JSON service definition formats
- https://developer.hashicorp.com/consul/docs/register/health-check/vm
Supports
- Check types: script, HTTP, TCP, UDP, TTL, Docker, gRPC, H2ping, alias, os_service
- New checks register as critical by default; status parameter sets initial state
- Script check exit codes (0 passing, 1 warning, other failing)
- HTTP check response codes (2xx-3xx healthy, 429 warning, others failing)
- Script checks require enable_local_script_checks or enable_script_checks
- Security warning on enable_script_checks remote execution risk
- TTL checks critical on expiry; TTL check pass/warn/fail/update endpoints
- https://developer.hashicorp.com/consul/docs/discover/dns
Supports
- DNS as the primary discovery interface when mesh is disabled in non-Kubernetes environments
- DNS recommended over native app integration because it is less invasive
- Static lookups and prepared queries with tag filtering and cross-datacenter failover
- https://developer.hashicorp.com/consul/docs/reference/dns
Supports
- DNS syntax elements: service.service.consul, node.node.consul, query.query.consul, connect.consul (Enterprise), datacenter scoping
- Default domain .consul
- SRV record format _service._protocol
- https://developer.hashicorp.com/consul/docs/secure
Supports
- Consul is not secure by default
- Security model table mapping gossip encryption, mTLS, and ACLs to Consul operations
- Gossip encryption secures agent broadcast traffic
- mTLS for Raft, RPC, HTTP/gRPC interfaces; private CA recommendation
- ACL system authenticates API, UI, CLI, catalog, DNS access
- enable_script_checks remote execution vulnerability warning; recommendation of enable_local_script_checks
- Client agents bind HTTP/DNS/gRPC to localhost by default
- https://developer.hashicorp.com/consul/docs/secure-mesh/intention
Supports
- Intentions control service-to-service traffic at L4 (identity) or L7 (HTTP attributes)
- L4 intentions govern new connections; existing connections survive changes
- L7 intentions govern new requests; enforcement after modification
- Intention caching on agents and proxies; blocking queries for near-instant propagation
- Deny takes precedence over allow at equal specificity; precedence table
- default_policy configuration determines allow/deny default behavior
- https://developer.hashicorp.com/consul/docs/connect/proxy
Supports
- Sidecar proxies transparently handle inbound/outbound connections and wrap/verify TLS
- Built-in L4 proxy suitable for development, not recommended for production
- Envoy first-class support via gRPC xDS API on the local agent
- Service mesh proxies do not support dynamic upstreams without native integration
- https://developer.hashicorp.com/consul/docs/reference/architecture/ports
Supports
- Port table: DNS 8600, HTTP 8500, HTTPS 8501 (disabled), gRPC 8502 (disabled), gRPC TLS 8503, server RPC 8300, LAN Serf 8301, WAN Serf 8302
- Client ports and default enabled/disabled states
- HTTP port serves API, CLI, and UI
- https://developer.hashicorp.com/consul/docs/use-case
Supports
- Consul combining service discovery, mesh, DNS, configuration management, and API gateway in one product
- Competing products table (Eureka, ZooKeeper, Istio, Linkerd, NS1, Chef, Puppet, Kong)
- https://developer.hashicorp.com/consul/docs/fundamentals/editions
Supports
- Consul CE vs Enterprise feature matrix (multi-tenancy, resiliency, FIPS as Enterprise)
- Consul Self-Managed Standard and Premium licenses
- https://developer.hashicorp.com/consul/docs/architecture/backend
Supports
- WAL LogStore as default backend; BoltDB was the previous default
- Raft index written to the data directory; snapshot agent for backups
- https://developer.hashicorp.com/consul/commands
Supports
- Subcommand list (agent, members, catalog, kv, services, watch, snapshot, connect, intention, maint, reload, validate)
- CONSUL_HTTP_ADDR environment variable and token flags
- https://developer.hashicorp.com/consul/api-docs/kv
Supports
- KV values limited to 512 KB
- Transactions for atomic multi-key operations with a limit of 64 operations
- Each datacenter has its own KV store with no built-in replication
- https://developer.hashicorp.com/consul/docs/release-notes/consul/v1_10_x
Supports
- Transparent proxy release in 1.10 with iptables redirection and consul connect redirect-traffic
- Streaming enabled by default for service health
- xDS v3 and incremental xDS defaults
- Legacy ACL system deprecation
- https://developer.hashicorp.com/consul/docs/release-notes/consul/v1_19_x
Supports
- Refactored DNS server as default in 1.19, compatible with v1 and v2 catalogs
- https://developer.hashicorp.com/consul/docs/release-notes/consul/v1_22_x
Supports
- 1.22 highlights: multi-port service support, IPv4/IPv6 dual-stack for VMs and Kubernetes, PKCE for OIDC UI login
- Multi-port services via optional ports parameter in service definitions
- https://raw.githubusercontent.com/hashicorp/consul/v0.1.0/CHANGELOG.md
Supports
- Consul 0.1.0 initial release April 17, 2014
- https://raw.githubusercontent.com/hashicorp/consul/v0.5.0/CHANGELOG.md
Supports
- 0.5.0 features: gossip key rotation (keyring), TTL session health checks, reverse DNS PTR, service-specific addresses
- https://raw.githubusercontent.com/hashicorp/consul/v0.6.0/CHANGELOG.md
Supports
- 0.6.0 radix-tree state store replacing LMDB, network tomography and consul rtt command
- https://raw.githubusercontent.com/hashicorp/consul/v0.7.0/CHANGELOG.md
Supports
- 0.7.0 transactional KV API (/v1/txn), native ACL replication, server connection rebalancing
- https://raw.githubusercontent.com/hashicorp/consul/v1.2.0/CHANGELOG.md
Supports
- Consul 1.2.0 (June 26, 2018) introducing Connect service mesh beta with automatic TLS and identity-based authorization
- https://raw.githubusercontent.com/hashicorp/consul/v1.4.0/CHANGELOG.md
Supports
- Consul 1.4.0 new ACL system with accessor IDs, policy model, new CLI and UI
- https://raw.githubusercontent.com/hashicorp/consul/v1.6.0/CHANGELOG.md
Supports
- Consul 1.6.0 L7 traffic management config entries (service-router, service-splitter, service-resolver), mesh gateways, intention and CA replication
- https://raw.githubusercontent.com/hashicorp/consul/v1.7.0/CHANGELOG.md
Supports
- Consul 1.7.0 (February 11, 2020) Enterprise namespaces across ACLs, KV, sessions, catalog, Connect, UI
- https://raw.githubusercontent.com/hashicorp/consul/v1.8.0/CHANGELOG.md
Supports
- Consul 1.8.0 terminating gateway, ingress gateway, WAN federation over mesh gateways, JWT auth method, SSO and audit logging (Enterprise)
- https://raw.githubusercontent.com/hashicorp/consul/v1.10.0/CHANGELOG.md
Supports
- Consul 1.10.0 transparent proxy support, consul connect redirect-traffic command
- https://raw.githubusercontent.com/hashicorp/consul/v1.12.0/CHANGELOG.md
Supports
- Consul 1.12.0 (April 20, 2022) AWS IAM auth method, per-listener TLS configuration
- https://raw.githubusercontent.com/hashicorp/consul/v1.13.0/CHANGELOG.md
Supports
- Consul 1.13.0 (August 9, 2022) cluster peering beta, UDP health checks, transparent proxying through terminating gateways
- https://raw.githubusercontent.com/hashicorp/consul/v1.15.0/CHANGELOG.md
Supports
- Consul 1.15.0 (February 23, 2023) removal of legacy ACL system, experimental wal log storage backend
- https://raw.githubusercontent.com/hashicorp/consul/v1.18.2/CHANGELOG.md
Supports
- Consul 1.18.0 (February 27, 2024) peering failover, mesh gateway local mode, peering enabled by default in 1.14 config defaults
- Experimental v2 Catalog and Resource API feature preview (Kubernetes-only, not production)
- https://raw.githubusercontent.com/hashicorp/consul/v1.19.0/CHANGELOG.md
Supports
- Consul 1.19.0 (June 12, 2024) refactored DNS server default, API gateway metrics, file-system-certificate config entry
- https://raw.githubusercontent.com/hashicorp/consul/v1.22.0/CHANGELOG.md
Supports
- Consul 1.22.0 (October 24, 2025) multi-port service registration, dual-stack IPv4/IPv6 support, PKCE-enabled OIDC
- https://raw.githubusercontent.com/hashicorp/consul/v2.0.0/CHANGELOG.md
Supports
- Consul 2.0.0 (May 22, 2026) Envoy 1.37 upgrade, HTTP server timeout hardening for blocking queries, certificate expiry monitoring
- Enterprise global rate limiter config entry kind; multi-port mesh features (Enterprise)
- https://www.datadoghq.com/blog/engineering/consul-at-datadog/
Supports
- Datadog production Consul practices: server CPU sizing tied to leadership transitions
- git2consul for auditable configuration changes
- ACLs protecting the KV store
- Watches instead of high-rate direct queries; dnsmasq caching in front of Consul DNS (400 q/s to Consul serving 100,000 q/s)
- consul.raft.leader.lastContact and leader transition events as key metrics
- https://developer.hashicorp.com/consul/tutorials/get-started-vms/virtual-machine-gs-deploy
Supports
- Official getting-started tutorial series for Consul on VMs covering deploy, register, secure, and observe
- https://github.com/hashicorp-education/learn-consul-get-started-vms
Supports
- Reference server agent configuration (datacenter, data_dir, server, bootstrap_expect, retry_join, ui_config)
- HCL service definitions with sidecar_service upstreams (destination_name, local_bind_port)
- TCP health check definitions with interval and timeout
- ACL policy examples (node_prefix/service_prefix read for DNS)
- https://github.com/hashicorp/consul-template
Supports
- consul-template as the template rendering and notifier tool for Consul and Vault data
- https://github.com/josegonzalez/awesome-consul
Supports
- Ecosystem curation of Consul tooling: fabio, Traefik, registrator, confd, envconsul, consul-template, git2consul, consul-alerts
- https://github.com/hashicorp/consul-esm
Supports
- External Service Monitor runs health checks for services outside agent reach
- https://www.usenix.org/conference/srecon16/program/presentation/froese
Supports
- Datadog's SRECON16 presentation on running Consul at scale from RFC to production
