Objective
Add health check endpoints for Kubernetes liveness and readiness probes.
Requirements
- Add
GET /health/live endpoint (pod is alive)
- Add
GET /health/ready endpoint (dependencies ready: DB, Redis)
- Add
GET /metrics endpoint (Prometheus metrics)
Implementation
// api/internal/handlers/health.go
func LivenessCheck(c *gin.Context) {
c.JSON(200, gin.H{"status": "ok"})
}
func ReadinessCheck(c *gin.Context) {
// Check DB, Redis connections
c.JSON(200, gin.H{"status": "ready"})
}
Acceptance Criteria
Files to Create/Modify
api/internal/handlers/health.go (NEW)
api/cmd/main.go (add routes)
manifests/api-deployment.yaml (add probes)
Objective
Add health check endpoints for Kubernetes liveness and readiness probes.
Requirements
GET /health/liveendpoint (pod is alive)GET /health/readyendpoint (dependencies ready: DB, Redis)GET /metricsendpoint (Prometheus metrics)Implementation
Acceptance Criteria
/health/livereturns 200 OK/health/readyreturns 200 when healthy, 503 when notFiles to Create/Modify
api/internal/handlers/health.go(NEW)api/cmd/main.go(add routes)manifests/api-deployment.yaml(add probes)