Readiness Probes Fundamentals
What you'll learn: How readiness probes control which pods receive traffic from Kubernetes Services.
The Core Concept
A readiness probe determines whether a pod is ready to accept incoming traffic. Unlike liveness probes (which restart unhealthy pods), readiness probes control traffic routing. When a pod fails its readiness check, Kubernetes temporarily removes it from Service endpoints—no traffic flows to it until it passes the probe again.
Think of it like a restaurant server: a liveness probe checks if the server is alive and functioning. A readiness probe checks if they're ready to take orders right now (not overwhelmed, not on break). If they signal "not ready," the host stops seating customers at their tables until they're ready again.
Why Readiness Probes Matter
Pods need time to warm up—loading configuration, establishing database connections, populating caches. Without readiness probes, Kubernetes sends traffic immediately after a pod starts, causing errors and poor user experience.
Readiness probes also handle temporary unavailability gracefully. If a pod becomes overwhelmed or loses a critical dependency (like a database connection), it can signal "not ready" without being killed and restarted.
How It Works
- You configure a readiness probe in your pod specification
- Kubernetes periodically runs the probe (HTTP check, TCP socket, or command)
- If the probe succeeds, the pod stays in Service endpoints
- If it fails, Kubernetes removes the pod from all matching Services
- When the probe succeeds again, traffic resumes automatically
This is completely transparent to clients—they simply connect to the Service and get routed only to ready pods.
Key Takeaway: Readiness probes control traffic flow by adding or removing pods from Service endpoints based on their ability to handle requests, ensuring users only reach pods that are truly ready to serve traffic.