Last Updated: November 21, 2025
HashiCorp Consul
Service mesh and discovery
Core Features
| Item | Description |
|---|---|
Service Discovery
|
Find services dynamically |
Health Checking
|
Monitor service health |
KV Store
|
Distributed configuration |
Service Mesh
|
Secure service communication |
Multi-Datacenter
|
WAN federation |
Service Segmentation
|
Zero-trust networking |
Service Registration
{
"service": {
"name": "web",
"tags": ["rails"],
"port": 80,
"check": {
"http": "http://localhost:80/health",
"interval": "10s"
}
}
}
Common Commands
consul agent -dev
Start dev agent
consul members
List cluster members
consul catalog services
List services
consul kv put config/app value
Write KV data
consul kv get config/app
Read KV data
consul connect proxy
Start sidecar proxy
Best Practices
- Use health checks for all services
- Enable TLS for production
- Use intentions for service authorization
- Deploy as a cluster (not single node)
💡 Pro Tips
Quick Reference
Consul provides both service discovery and mesh