Skip to main content

Health Checks

Posta provides health check endpoints for container orchestration and load balancers.

Liveness Probe

GET /api/v1/healthz

Returns 200 OK if the server is running:

{
"status": "ok",
"timestamp": "2026-01-01T00:00:00Z"
}

Readiness Probe

GET /api/v1/readyz

Checks database and Redis connectivity:

{
"status": "ok",
"checks": {
"database": "ok",
"redis": "ok"
}
}

Returns 503 Service Unavailable if any dependency is down.

Application Info

GET /api/v1/info
{
"name": "posta",
"version": "1.0.0",
"commit": "abc123"
}

Kubernetes Configuration

livenessProbe:
httpGet:
path: /api/v1/healthz
port: 9000
initialDelaySeconds: 5
periodSeconds: 10

readinessProbe:
httpGet:
path: /api/v1/readyz
port: 9000
initialDelaySeconds: 10
periodSeconds: 15

Docker Compose

healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/api/v1/healthz"]
interval: 30s
timeout: 10s
retries: 3