Liveness & Readiness Probes
Health & Monitoring
Liveness & Readiness Probes
Kubernetes-compatible health probe endpoints
GET
Liveness & Readiness Probes
Overview
Aurora provides dedicated liveness and readiness probe endpoints for Kubernetes and container orchestration platforms. These endpoints enable fine-grained health monitoring and automated recovery strategies.Liveness Probe
Endpoint
Description
The liveness probe checks if the Flask application process is running and responsive. This is a lightweight check that doesn’t verify external dependencies. Kubernetes uses this to determine if the container should be restarted.Response
Always returns
"alive" if the application is runningStatus Codes
Application is alive and responsive
Example Response
Usage
Kubernetes Configuration
cURL
Readiness Probe
Endpoint
Description
The readiness probe checks if the application is ready to accept traffic by verifying critical dependencies (database and Redis). Kubernetes uses this to determine if the pod should receive traffic from the service load balancer.Response
Ready State
Returns
"ready" when critical services are availableNot Ready State
Returns
"not_ready" when critical services are unavailableHealth status of critical services
Status Codes
Application is ready to accept traffic (both database and Redis are healthy)
Application is not ready (database or Redis is unhealthy)
Example Responses
Ready
Not Ready
Usage
Kubernetes Configuration
cURL
JavaScript
Python
Probe Comparison
| Aspect | Liveness Probe | Readiness Probe |
|---|---|---|
| Purpose | Detect if application is hung/crashed | Detect if application can serve traffic |
| Checks | Application process only | Database + Redis |
| Failure Action | Restart container | Remove from load balancer |
| Response Time | Very fast (~1ms) | Moderate (~50-100ms) |
| Use When | Container orchestration | Load balancing |
Best Practices
Liveness Probe Configuration
- Initial Delay: Set
initialDelaySecondsto allow application startup (30-60 seconds) - Period: Check frequently (10-30 seconds)
- Timeout: Keep short (5 seconds)
- Threshold: Allow 2-3 failures before restart to avoid flapping
Readiness Probe Configuration
- Initial Delay: Short delay (10-15 seconds) as dependencies should start first
- Period: Check frequently (5-10 seconds) for fast recovery
- Timeout: Moderate timeout (3-5 seconds)
- Threshold: Single success to start receiving traffic, 2-3 failures to stop
Combined Configuration Example
Monitoring Recommendations
Metrics to Track
- Liveness Failures: Alert on repeated liveness failures indicating application crashes
- Readiness Failures: Track dependency health issues (database, Redis)
- Recovery Time: Monitor time from not-ready to ready state
- Probe Response Time: Detect performance degradation
Alert Examples
Related Endpoints
- Health Status - Comprehensive health check for all services