Kasm Services Healthcheck
Overview
The healthcheck system is a container-based health monitoring solution that monitors the health of Kasm Workspaces Docker services. Each service container uses a custom script that performs health validation with exponential backoff retry logic and state persistence across container restarts.
Healthcheck Endpoints
Each service provides standardized healthcheck endpoints that return JSON responses indicating service status:
> curl -k https://<kasm-server>/api/__healthcheck
{"ok": true}
Healthcheck Script Parameters
The container healthcheck system uses /usr/bin/healthcheck.sh
with the following parameters:
/usr/bin/healthcheck.sh <target_url> <port> <retry_delay> <max_delay> <healthcheck_timeout>
Parameter Details
Parameter | Description | Example | Required |
---|---|---|---|
target_url | HTTP/HTTPS endpoint to validate service health | http://localhost:8080/api/__healthcheck | Yes |
port | TCP port to verify is listening (use "" to skip) | 3389 or "" | No |
retry_delay | Delay between retries in seconds (default: 1 ) | 5 | No |
max_delay | Maximum delay for exponential backoff (default: 30 ) | 60 | No |
healthcheck_timeout | The maximum time allowed for performing the healthcheck curl command (default: 5 ) | 10 | No |
Example Configurations
API Service:
/usr/bin/healthcheck.sh http://localhost:8080/api/__healthcheck "" 5 60
RDP Gateway (with port check):
/usr/bin/healthcheck.sh http://localhost:5555/__healthcheck 3389 1 30
Agent Service (longer delays):
/usr/bin/healthcheck.sh http://localhost:4444/__healthcheck "" 30 90
Docker Healthcheck Considerations
While standard Docker healthcheck parameters (interval
, timeout
, retries
, start_period
) apply to all services, ensure the Docker timeout
parameter is not less than the script's internal healthcheck_timeout
.