1. Architecture and scope
A model process can exist before its weights and service dependencies are ready for requests. Kubernetes gives startup, readiness and liveness probes different roles. A configured startup probe gates the other two until it succeeds. Readiness affects service traffic; liveness can cause a container restart after the configured failures. [1] [2]
A request deadline answers a different question: how long the caller waits for an operation. Python’s asyncio.wait_for cancels the awaited task on timeout and waits for cancellation to complete, so elapsed time can exceed the timeout. A cancellation request is not proof that all underlying computation or external side effects have stopped. [3]
Scope. A toy control decision model based on Kubernetes probe roles. It does not operate a cluster or contact a model endpoint.
Workflow and scope notes
- Initialize service. Allow the application to initialize under its configured startup policy. The toy holds the other checks while startup has not succeeded.
- Evaluate signals. After startup, evaluate readiness and liveness independently. Readiness does not gate liveness in the actual probe design.
- Apply controls. Readiness controls eligibility for normal Service traffic; liveness failures can trigger restart. The toy uses a liveness failure threshold of three.
- Observe requests. Record timeout, cancellation completion and request outcome separately. Request timeout handling is separate from the probe state shown below.
2. Probe role decision model
Startup is configured. Before it succeeds, readiness and liveness are not evaluated. Afterward, vary readiness and a consecutive liveness-failure streak. The fictional restart threshold is three.
Probe role decision model
Original synthetic experiment · Change an input to update the figure.
This is an instantaneous decision model. It omits probe periods, startup failure budget, termination grace periods, restart policy and transient endpoint propagation. A restart decision does not mean traffic removal or restart has already completed.
Calculation record
{
"inputs": {
"started": "yes",
"ready": "no",
"failures": "1"
},
"route": false,
"restart": false,
"outcome": "Not ready"
}| Case | Result | Interpretation |
|---|---|---|
| Startup has not succeeded | Other probes gated | This model does not simulate exhausting the startup failure budget. |
| Started, readiness fails, liveness passes | Not ready; no liveness restart | A readiness failure alone is not the liveness restart condition. |
| Started, 3 liveness failures | Restart decision | Three is this example’s chosen threshold, not a universal default. |
3. Interpretation and limitations
The readiness result and liveness failure counter are drawn on separate lanes. At readiness No with zero liveness failures, the model is not eligible for normal Service traffic but has no liveness-triggered restart. At threshold, the restart decision takes priority in the summary; the diagram still preserves the separate readiness signal. [1] [2]
An HTTP success from a health endpoint says only what that endpoint checks. Editorial design questions include whether readiness should include successful model initialization and required dependencies, and whether a liveness check can mistake slow useful work for a deadlock. This notebook does not prescribe a single probe for every serving system. [1]
For Python 3.13, a wait_for timeout normally raises TimeoutError after requesting task cancellation. Cleanup can extend the wait. When an inference call delegates work to another process or remote service, confirm that system’s own cancellation behavior rather than assuming a client timeout stops it. [3]
Set startup to No and change every other control. Explain why the model continues to gate those probes. Then enable startup, fail readiness and set zero liveness failures: describe the two independent outputs.
4. Worked Python example
The core calculation below uses only the Python standard library. The full download adds the verification assertions and input fixtures. It runs locally on synthetic data; it does not load a model or contact a service.
from itertools import product
def probes(started, ready, failures):
if not started:
return {"route": False, "restart": False,
"outcome": "Startup gate"}
restart = failures >= 3 # Chosen toy threshold, not a universal default.
return {"route": ready and not restart, "restart": restart,
"outcome": "Restart decision" if restart else
"Ready for traffic" if ready else "Not ready"}
Download full Python example and checks ↓
Run: python -I lab.py. Recorded run: Python 3.13; 20 fixture states plus scenario assertions passed. The JSON output is a reproducibility record, not a real-system benchmark.
5. Questions and explanations
Predict before opening the explanation. Answers refer to the stated scope and synthetic inputs.
References and source links
- Kubernetes contributors. (Documentation accessed 2026). Liveness, Readiness, and Startup Probes | Kubernetes.https://kubernetes.io/docs/concepts/workloads/pods/probes/
- Kubernetes contributors. (Documentation accessed 2026). Configure Liveness, Readiness and Startup Probes | Kubernetes.https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
- Python Software Foundation. (Python 3.13.18 documentation). Coroutines and tasks — Python 3.13.18 documentation.https://docs.python.org/3.13/library/asyncio-task.html
Source checks and provenance
Primary publisher pages and relevant passages checked on 13 Nov 2026. Source support is not independent expert fact verification. Main documentation can change; retrieved-body hashes, dates, version labels and saved revision IDs are in the audit download.
Evidence: Startup probe; Liveness probe; Readiness probe. Role distinctions in current official documentation; concrete probe design is application-specific.
Evidence: Define readiness probes; probe configuration. Failure thresholds and lifecycle behavior; no deployment manifest is applied.
Evidence: asyncio.wait_for. Cancellation completion can take longer than the timeout; this is not a hard process kill.