feat: add dedicated health check endpoints for flightdeck#77
feat: add dedicated health check endpoints for flightdeck#77ian-flores merged 3 commits intomainfrom
Conversation
- Add /healthz endpoint for liveness probe (lightweight, no external calls) - Add /readyz endpoint for readiness probe (checks k8s API connectivity) - Update controller to use new probe paths instead of homepage - Add unit tests for health check endpoints - Update controller tests to verify new probe paths This prevents probe failures due to k8s API issues from being misinterpreted as flightdeck being unhealthy.
|
Claude finished @ian-flores's task —— View job Reviewing PR
Review submitted with suggestions for:
|
There was a problem hiding this comment.
Overall
Good implementation separating liveness from readiness probes. The approach correctly uses /healthz as a lightweight liveness check and /readyz to verify k8s API connectivity.
Controller Changes Checklist
- Reconciliation remains idempotent
- Error handling unchanged (N/A for probe paths)
- Unit tests updated to verify new probe paths
Flightdeck Checklist
- New endpoints render correctly (plain text responses)
- Unit tests cover success and failure cases
Suggestions
flightdeck/http/server.go:37-38 - Probe Logging
Health check endpoints will be called frequently by Kubernetes (every 3-10 seconds per the probe config). The requestLoggingMiddleware logs these at Info level for non-static paths, which could flood logs in production.
Consider adding /healthz and /readyz to the debug-only logging path (similar to how static assets are handled at line 71):
// In requestLoggingMiddleware
if len(r.URL.Path) > 7 && r.URL.Path[:8] == "/static/" ||
r.URL.Path == "/healthz" || r.URL.Path == "/readyz" {
slog.Debug(...)
} else {
slog.Info(...)
}flightdeck/http/server_test.go:94 - Missing Newline
File is missing a trailing newline.
Minor Notes
- The
w.Write([]byte(...))return values are intentionally ignored, which is fine for these simple responses - Tests provide good coverage of the happy path and k8s API failure scenarios
- Reduce log verbosity for /healthz and /readyz endpoints to debug level - Add missing trailing newline to server_test.go - Regenerate manifests to sync Helm chart with kustomize CRDs
|
Confirmed this is working on |
# [1.8.0](v1.7.0...v1.8.0) (2026-02-10) ### Features * add dedicated health check endpoints for flightdeck ([#77](#77)) ([484b78a](484b78a))
Summary
Context
Currently, flightdeck uses the homepage (/) for both liveness and readiness probes. This is problematic because the homepage fetches Site CRs from the Kubernetes API on every request. This means probe failures could be caused by k8s API issues rather than flightdeck itself being unhealthy.
What Changed
Testing
Fixes #40