Loading...
Loading...
Configures health check endpoints for Kubernetes readiness/liveness/startup
npx skill4agent add levnikolaevich/claude-code-skills ln-774-healthcheck-setup| Aspect | Details |
|---|---|
| Input | Context Store from ln-770 |
| Output | Health check endpoints and Kubernetes probe configuration |
| Stacks | .NET (AspNetCore.Diagnostics.HealthChecks), Python (FastAPI routes) |
STACKPROJECT_ROOTAddHealthChecksMapHealthChecks/health{ "status": "skipped" }| Dependency | .NET Detection | Python Detection |
|---|---|---|
| PostgreSQL | | |
| MySQL | | |
| Redis | | |
| RabbitMQ | | |
| MongoDB | | |
| Endpoint | Probe Type | Purpose | Checks |
|---|---|---|---|
| Liveness | Is app alive? | App responds (no dependency checks) |
| Readiness | Can app serve traffic? | All dependencies healthy |
| Startup (K8s 1.16+) | Is app initialized? | Initial warmup complete |
| Probe | Failure Action | Kubernetes Behavior |
|---|---|---|
| Liveness | Container restart | kubelet restarts container |
| Readiness | Remove from service | Traffic stopped, no restart |
| Startup | Delay other probes | Liveness/Readiness paused |
MCP ref: "ASP.NET Core health checks Kubernetes probes"
Context7: /dotnet/aspnetcoreMCP ref: "FastAPI health check endpoint Kubernetes"
Context7: /tiangolo/fastapi| Parameter | Liveness | Readiness | Startup |
|---|---|---|---|
| 10 | 5 | 0 |
| 10 | 5 | 5 |
| 5 | 3 | 3 |
| 3 | 3 | 30 |
| 1 | 1 | 1 |
Max startup time = initialDelaySeconds + (periodSeconds × failureThreshold)
Default: 0 + (5 × 30) = 150 seconds| File | Purpose |
|---|---|
| Health check registration |
| Custom startup check |
AspNetCore.HealthChecks.NpgSqlAspNetCore.HealthChecks.RedisAspNetCore.HealthChecks.MySqlbuilder.Services.AddHealthCheckServices(builder.Configuration);
// ...
app.MapHealthCheckEndpoints();| File | Purpose |
|---|---|
| Health check router |
| Dependency health checks |
from routes.health import health_router
app.include_router(health_router)livenessProbe:
httpGet:
path: /health/live
port: 5000
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3
readinessProbe:
httpGet:
path: /health/ready
port: 5000
initialDelaySeconds: 5
periodSeconds: 5
timeoutSeconds: 3
failureThreshold: 3
startupProbe:
httpGet:
path: /health/startup
port: 5000
periodSeconds: 5
failureThreshold: 30dotnet build --no-restorepython -m py_compile routes/health.pycurl http://localhost:5000/health/live
curl http://localhost:5000/health/ready
curl http://localhost:5000/health/startup{
"status": "Healthy",
"checks": {
"database": { "status": "Healthy", "duration": "00:00:00.0234" },
"redis": { "status": "Healthy", "duration": "00:00:00.0012" }
},
"totalDuration": "00:00:00.0250"
}/health/ready/health/live{
"status": "success",
"files_created": [
"Extensions/HealthCheckExtensions.cs",
"HealthChecks/StartupHealthCheck.cs"
],
"packages_added": [
"AspNetCore.HealthChecks.NpgSql"
],
"registration_code": "builder.Services.AddHealthCheckServices(configuration);",
"message": "Configured health checks with liveness, readiness, and startup probes"
}