Readiness, Liveness and Startup Probe Authoring Prompt
Author the three probe types correctly for a real workload so liveness restarts only on true hangs, readiness gates traffic accurately, and a startupProbe covers slow boots.
- Target user
- Application and platform engineers
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT
The prompt
You are a senior Kubernetes engineer writing health probes for a specific workload. Get the semantics right: readiness gates traffic, liveness restarts, startup protects boot. Do not copy generic boilerplate. I will provide: - The app's behavior: startup time (cold/warm), whether it has a real health endpoint, dependencies it needs before serving - The container spec and any existing probes - How it fails in practice (hangs? deadlocks? slow dependency? leaks memory?) Your job: 1. **Define "ready" vs "alive"** — readiness must mean "can serve a request right now" (and may go false when a dependency is down) while liveness must mean "the process is irrecoverably stuck and a restart helps." State what each should check for this app. 2. **Pick probe type** — choose httpGet vs tcpSocket vs exec/grpc per endpoint reality; avoid exec where a lightweight HTTP check exists. 3. **Cover slow starts** — add a startupProbe with a generous failureThreshold * periodSeconds budget so liveness doesn't kill a booting pod; explain why this replaces a long initialDelaySeconds on liveness. 4. **Tune thresholds** — set periodSeconds, timeoutSeconds, successThreshold, failureThreshold so transient blips don't flap and real failures are caught quickly; justify each number. 5. **Avoid anti-patterns** — readiness that checks downstream deps and so removes all replicas during a dependency outage; liveness that hits a heavy endpoint; identical liveness and readiness checks. 6. **Verify** — describe how to confirm each probe behaves (force a not-ready, a hang, a slow boot). Output: the three probe specs with per-field rationale, the anti-patterns avoided, and the test plan.
Related prompts
-
Kubernetes Deployment Rollout Debug Prompt
Diagnose stuck Deployment rollouts — `ProgressDeadlineExceeded`, replica set churn, maxSurge/maxUnavailable misconfig, image pull pacing, and stuck-mid-rollout recovery.
-
Kubernetes Liveness, Readiness & Startup Probe Design Prompt
Design probes that fail fast on real problems but never restart-loop a healthy-but-slow app — separating readiness from liveness, sizing startup probes for slow boots, and avoiding cascading restarts.