Skip to content

docs: add guide for Kubernetes liveness and readiness probes#15911

Open
marcelomarkus wants to merge 3 commits into
fastapi:masterfrom
marcelomarkus:docs-kubernetes-probes
Open

docs: add guide for Kubernetes liveness and readiness probes#15911
marcelomarkus wants to merge 3 commits into
fastapi:masterfrom
marcelomarkus:docs-kubernetes-probes

Conversation

@marcelomarkus

Copy link
Copy Markdown
Contributor

Discussion: #10370 (This PR implements a planned item from the official roadmap)

Description

This PR implements the following item from the official roadmap (#10370):

  • Docs for liveness and readiness for Kubernetes and others.

It adds a new page docs/en/docs/deployment/kubernetes.md to guide developers on configuring Kubernetes probes for FastAPI.

What it covers:

  • Core Concepts: Explanation of Startup, Liveness, and Readiness probes and how they interact with FastAPI's lifespan startup phase.
  • FastAPI Code Examples:
    • Basic health check endpoint configuration (docs_src/kubernetes/tutorial001.py).
    • Production-ready sample (docs_src/kubernetes/tutorial002.py) demonstrating separate /healthz and /readyz endpoints, database connection checks, and a custom logging.Filter to prevent Uvicorn log spam from frequent health check requests.
  • Kubernetes Manifest (YAML): A standard deployment manifest snippet showcasing how to map the endpoints to startup, liveness, and readiness probes.

Checklist

  • This PR links to a GitHub Discussion for the proposed code change.
  • The documentation explains the change if needed.

@github-actions github-actions Bot added the docs Documentation about how to use FastAPI label Jul 1, 2026
@codspeed-hq

codspeed-hq Bot commented Jul 1, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 20 untouched benchmarks


Comparing marcelomarkus:docs-kubernetes-probes (de863f0) with master (cecd96d)

Open in CodSpeed

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation about how to use FastAPI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant