Service Discovery
In Kubernetes, Docker Swarm, or any auto-scaling environment, service instances come and go. Hard-coding http://inventory-service:8080 breaks the moment a container restarts on a different port or IP. Service discovery solves this with a registry: each instance registers itself on startup ("I am inventory-service, version 2.1, at 10.0.4.12:8080, healthy") and deregisters on shutdown. Clients — or an API Gateway, or a service mesh sidecar — query the registry to find a healthy instance before each request. Kubernetes DNS (inventory-service.default.svc.cluster.local) is a built-in form of service discovery. Consul, Eureka, and etcd are standalone registries used outside Kubernetes or for multi-cluster setups.