Let's think about it this way for a second
A container process might not crash, but the app could still be deadlocked (unable to respond to requests) — from Kubernetes's point of view, the container just keeps showing as 'Running' (since the process itself is still alive). A Liveness Probe periodically checks whether the app is actually working, and restarts the container if it fails. A Readiness Probe checks whether the app is ready to accept traffic — if it fails, the Service holds off sending traffic to that pod for a while (especially useful for apps with slow container startup).
Let's connect this to a real scenario
Say a web app has a `/healthz` endpoint, and the Liveness Probe sends an HTTP request every 10 seconds — if it doesn't get a 200 response, the container gets restarted. If an app has a slow database connection pool setup, a Readiness Probe means the Service won't send traffic during that startup window, only once setup is done — protecting users from hitting errors.
Let's look at it together
apiVersion: v1
kind: Pod
metadata:
name: web-with-probes
spec:
containers:
- name: web
image: my-app:latest
livenessProbe:
httpGet:
path: /healthz
port: 8080
periodSeconds: 10
readinessProbe:
httpGet:
path: /ready
port: 8080
initialDelaySeconds: 5
periodSeconds: 5$ kubectl describe pod web-with-probes
...
Liveness: http-get http://:8080/healthz delay=0s timeout=1s period=10s
Readiness: http-get http://:8080/ready delay=5s timeout=1s period=5s5-Minute Try-It
Write YAML for a pod with both a Liveness and a Readiness probe, apply it, then confirm the probe config with `kubectl describe pod`.
A Quick Word of Caution
Don't use the same endpoint for both the Liveness Probe and the Readiness Probe — Liveness asks 'am I still alive' (a light check), while Readiness asks 'can I accept traffic yet' (which can include dependency checks). They serve different purposes.