πŸ“šBook Signing at KubeCon EU 2026Meet us at Booking.com HQ (Mon 18:30-21:00) & vCluster booth #521 (Tue 24 Mar, 12:30-1:30pm) β€” free book giveaway!RSVP Booking.com Event
Deployments beginner ⏱ 10 minutes K8s 1.28+

Readiness Probe Kubernetes Guide

Configure readiness probes correctly on Kubernetes. HTTP, TCP, exec probes, failure threshold tuning, and why readiness probes should never check databases.

By Luca Berton β€’ β€’ πŸ“– 5 min read

πŸ’‘ Quick Answer: Configure readiness probes correctly on Kubernetes. HTTP, TCP, exec probes, failure threshold tuning, and why readiness probes should never check databases.

The Problem

Without a readiness probe, Kubernetes considers a pod ready to serve traffic the moment its container starts β€” before it’s actually loaded config, warmed a cache, or connected to a database. Traffic arrives at a pod that can’t yet handle it, producing errors during every rollout and every cold start.

The Solution

HTTP, TCP, and Exec Readiness Probes

readinessProbe:
  httpGet:
    path: /ready
    port: 8080
  initialDelaySeconds: 5
  periodSeconds: 5
  timeoutSeconds: 3
  failureThreshold: 3
# TCP β€” for non-HTTP services
readinessProbe:
  tcpSocket: {port: 3306}
# Exec β€” for custom readiness logic
readinessProbe:
  exec: {command: ["cat", "/tmp/ready"]}

Probe Parameters

ParameterDefaultDescription
initialDelaySeconds0Wait before the first probe
periodSeconds10How often to probe
timeoutSeconds1Probe timeout
successThreshold1Consecutive successes to mark ready
failureThreshold3Consecutive failures to mark not-ready

What Belongs in a Readiness Endpoint

// /ready β€” checks dependencies, unlike liveness
app.get('/ready', async (req, res) => {
  try {
    await db.ping();
    await redis.ping();
    res.status(200).json({ status: 'ready' });
  } catch (error) {
    res.status(503).json({ status: 'not ready', error: error.message });
  }
});

Common Issues

IssueCauseFix
Errors during every rolloutNo readiness probe β€” traffic arrives before the app can serve itAdd a readiness probe that checks real serving capacity (DB/cache connections)
Pod flaps in and out of the ServicefailureThreshold: 1 β€” a single transient blip removes it from rotationUse failureThreshold: 3 or higher to tolerate brief hiccups
Readiness never passesEndpoint checks a condition that’s never true in normal operationVerify the readiness condition is actually reachable during steady-state, not just at one lifecycle moment
Readiness probe times out under loadtimeoutSeconds too low, or the endpoint itself does expensive workKeep the readiness check itself cheap β€” a dependency ping, not a full query; raise timeoutSeconds if needed

Best Practices

  • Never check a database directly in a liveness probe β€” that’s what readiness is for. A liveness probe that queries the DB restarts every pod the moment the DB blips, turning a transient outage into a thundering-herd restart storm
  • Return 503, not 200, when not ready β€” during startup, shutdown, or a lost dependency, an explicit 503 is what removes the pod from Service endpoints
  • Set failureThreshold β‰₯ 3 β€” tolerate a couple of missed checks before pulling a pod out of rotation
  • Use readiness for graceful shutdown too β€” fail readiness as soon as SIGTERM arrives so no new traffic routes to a terminating pod, even before it stops accepting connections
  • Keep the readiness check itself fast and cheap β€” a connection ping, not a full query against every dependency

Key Takeaways

  • A missing readiness probe means Kubernetes routes traffic to a pod the instant its container starts, not when it’s actually able to serve
  • Readiness failure removes a pod from Service endpoints without restarting it β€” the opposite of a liveness failure
  • Readiness endpoints should check real dependencies (DB, cache); liveness endpoints should not
  • failureThreshold and periodSeconds together set your tolerance for transient blips before a pod is pulled from rotation
  • Pairing readiness with graceful shutdown (fail readiness on SIGTERM) closes the gap where traffic still arrives during termination
#readiness-probe #health-check #http-get #tcp-socket
Luca Berton
Written by Luca Berton

Principal Solutions Architect specializing in Kubernetes, AI/GPU infrastructure, and cloud-native platforms. Author of Kubernetes Recipes and creator of CopyPasteLearn courses.

Kubernetes Recipes book cover

Want More Kubernetes Recipes?

This recipe is from Kubernetes Recipes, our 750-page practical guide with hundreds of production-ready patterns.

Luca Berton Ansible Pilot Ansible by Example Open Empower K8s Recipes Terraform Pilot CopyPasteLearn ProteinLens