📡 You're offline — showing cached content
New version available!
Quick Access
Tutorials Microservices Service Discovery

Service Discovery

5 min read
Service discovery lets services find each other dynamically — Kubernetes DNS handles this automatically.

Service Discovery

In dynamic environments containers start and stop constantly. Service discovery lets services find each other automatically.

# Tools
# Kubernetes DNS -- built-in, automatic
# Consul    -- HashiCorp, health-aware
# Eureka    -- Netflix OSS, Java-heavy

# Kubernetes DNS (automatic)
# Service named 'user-service' in 'default' namespace:
http://user-service                           # same namespace
http://user-service.default.svc.cluster.local # FQDN

# Consul registration
POST /v1/agent/service/register
{
  "Name": "user-service",
  "Port": 3001,
  "Check": {"HTTP":"/health","Interval":"10s"}
}