liveBook · Manning

Service discovery

As explained in Platform Engineering on Kubernetes

Service discovery is the mechanism by which services locate and communicate with one another through stable names instead of changing network addresses.

Service discovery lets Kubernetes-hosted services communicate through stable names rather than the physical IP addresses of individual pods. A Kubernetes Service provides the routing abstraction between deployments and their containers, allowing callers to find replicas without tracking addresses that change during upgrades, rescheduling, or restarts. section 2.3.4 section 2.1.2

Service discovery addresses several practical Kubernetes concerns:

  • Services route traffic to containers managed by deployments and balance requests across their replicas. section 2.1.2
  • Callers can use a service name instead of learning pod IP addresses, which may change when pods are upgraded, moved, or restarted. section 2.3.4
  • Dynamic discovery does not make an application resilient by itself; downstream services can still go down and require application-level preparation. section 2.4
  • Large applications may accumulate complex YAML for many services, making change tracking and kubectl-based deployment harder to manage. section 2.1.2

Connecting Conference services

In the Conference application, one service can address another through its Kubernetes Service name. The destination can be upgraded, rescheduled, or restarted while the caller continues using the stable name rather than a changing pod address. section 2.3.4

How Platform Engineering on Kubernetes covers it

How deep it goes
Defines Kubernetes Services as routing and load-balancing abstractions, but defers detailed resource management.
Examples
Uses the Conference application, Kubernetes Services, service names, replicas, and changing pod IP addresses.
What it assumes
Assumes familiarity with containers, Kubernetes deployments, and cluster resources while teaching name-based service communication.
What you can do after
Operate/configure Kubernetes Services so applications address replicas through stable names instead of pod IP addresses.
How it connects
Connects Kubernetes Services with deployments, pods, load balancing, Ingress, and application resiliency.

Also explained in

Compare how 7 books explain service discovery →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Platform Engineering on Kubernetes. The section links point to the parts of the book it draws on.