-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
User Story
As a DevOps engineer maintaining containerized services,
I want to implement a healthcheck endpoint in the backend API
so that container orchestration tools can monitor service availability and automate recovery.
Background
The current FastAPI implementation in backend/app/main.py lacks a dedicated health probe endpoint. This prevents Kubernetes/Docker from performing liveness/readiness checks, risking undetected service degradation during deployments or runtime failures. The existing GET / endpoint (line 14) only serves basic functionality without operational awareness capabilities. Missing healthchecks could lead to prolonged downtime if containers remain scheduled while the application is unresponsive.
Acceptance Criteria
- Add
/healthzendpoint tobackend/app/main.pythat returns HTTP 200 + JSON{"status": "healthy"} - Endpoint must execute within 2 seconds for Kubernetes probe timeouts
- Update backend Dockerfile to expose healthcheck configuration if required
- Verify endpoint accessibility via
curl -I http://localhost:80/healthz - Confirm Kubernetes would interpret HTTP 200 as healthy status through manual testing
- Ensure endpoint doesn't require authentication and has minimal dependencies
- Add endpoint documentation to the API section of README.md
- Maintain existing CORS configuration (lines 8-13) for the new endpoint
- Test container restart behavior when intentionally breaking the healthcheck