What are liveness, readiness and startup probes?
BeginnerConceptContainers & Kubernetes basics
Answer
In one line: Probes are health checks Kubernetes runs on containers: liveness asks "is it stuck — should I restart it?", readiness asks "can it take traffic right now?", and startup asks "has it finished starting yet?"
Liveness probe
- If it fails repeatedly, Kubernetes restarts the container.
- Catches apps that are running but stuck (deadlock, frozen thread).
Readiness probe
- If it fails, the pod is removed from Service endpoints — no traffic is sent to it — but it is not restarted.
- Used during startup (warming caches, connecting to the database) and when the app is temporarily overloaded.
- Critical for zero-downtime rolling updates: new pods only get traffic once they're ready.
Startup probe
- For slow-starting apps. Liveness and readiness checks wait until the startup probe succeeds, so the app isn't killed while still booting.
Example:
containers:
- name: orders
image: myrepo/orders:1.4.2
startupProbe:
httpGet: { path: /health/started, port: 8080 }
failureThreshold: 30
periodSeconds: 5 # allows up to 150 s to start
readinessProbe:
httpGet: { path: /health/ready, port: 8080 }
periodSeconds: 5
livenessProbe:
httpGet: { path: /health/live, port: 8080 }
periodSeconds: 10
failureThreshold: 3
Probe types: httpGet, tcpSocket, exec (run a command), grpc.
Common mistakes:
- Liveness checking the database — if the database is slow, every pod restarts, making the outage worse. Liveness should only check the app process itself; dependencies belong in readiness (carefully).
- No readiness probe — traffic reaches pods before they're ready, causing errors during deployments.
- Timeouts too short — healthy pods get killed under load, causing restart loops.
Tip for interviews: explain the difference between "restart" (liveness) and "stop sending traffic" (readiness) — that's what interviewers are checking.
More on Containers & Kubernetes basics
What is the difference between a Docker image and a container?BeginnerWhat makes a good Dockerfile? Give some best practices.BeginnerWhat is Kubernetes, and why do we need it?BeginnerExplain the Kubernetes architecture in simple terms.BeginnerWhat are Pods, Deployments and Services in Kubernetes?BeginnerWhat are resource requests and limits in Kubernetes?Beginner