HashiCorp Consul provides service discovery, configuration, and segmentation for any runtime platform and cloud.
What You Get for Free
- Service discovery — DNS and HTTP API
- Health checking — automatic service monitoring
- KV store — distributed configuration
- Service mesh — mTLS between services via Connect
- Multi-datacenter — WAN federation
- ACLs — fine-grained access control
Quick Start
consul agent -dev
UI at http://localhost:8500.
Register a Service
{
"service": {
"name": "web",
"port": 8080,
"check": {
"http": "http://localhost:8080/health",
"interval": "10s"
}
}
}
Discover Services
dig @127.0.0.1 -p 8600 web.service.consul
curl http://localhost:8500/v1/catalog/service/web
Consul vs etcd
| Feature | Consul | etcd |
|---|---|---|
| Service discovery | Built-in | Manual |
| Health checks | Built-in | External |
| UI | Built-in | No |
| Service mesh | Yes (Connect) | No |
Need service discovery setup? Check my work on GitHub or email spinov001@gmail.com for consulting.
Top comments (0)