Service Discovery and DNS in Kubernetes
Learn how containers find each other: cluster DNS, Service objects, and the resolution flow that makes microservices addressable by name.
The Discovery Problem
Container IPs are ephemeral — pods restart and get new addresses constantly. Hardcoding IPs is impossible.
Service discovery lets workloads find each other by stable names instead of changing IPs.
The Service Abstraction
A Kubernetes Service provides a stable virtual IP (ClusterIP) and DNS name that load-balances across a set of pods selected by labels.
apiVersion: v1
kind: Service
metadata:
name: orders
spec:
selector:
app: orders
ports:
- port: 80All lessons in this course
- Docker Network Modes
- Kubernetes Networking Basics
- Network Policies in Containers
- Service Discovery and DNS in Kubernetes