Health Checks

After a successful deploy, muster runs the service's health.sh hook (if health is enabled and the hook exists). Exit 0 means healthy, non-zero means unhealthy.

Health check types

Configure health check types during muster setup or via CLI flags:

Types

NameDescription
HTTP
http:<endpoint>:<port>HTTP endpoint check. Example: --health api=http:/health:8080
TCP
tcp:<port>TCP port check. Example: --health redis=tcp:6379
Command
command:<cmd>Custom command check. Example: --health worker=command:./check.sh
Disabled
noneDisable health checks. Example: --health api=none

Failure behavior

If the health check fails after deploy, an interactive menu offers:

Recovery options

NameDescription
Continue anyway
actionProceed to next service.
Rollback <name>
actionRun the rollback hook for the failed service.
Abort
actionStop the deploy.

Health timeout defaults

Timeout by environment

NameDescription
Production
durationHealth check timeout for production environments. Default: 30s
Staging
durationHealth check timeout for staging environments. Default: 15s
Development
durationHealth check timeout for development environments. Default: 5s

The health.sh hook

The health.sh hook receives the same environment variables as other hooks. Exit 0 for healthy, non-zero for unhealthy.

bash
#!/usr/bin/env bash
set -euo pipefail

# Check HTTP endpoint
curl -sf http://localhost:8080/health > /dev/null || exit 1

# Verify database connectivity
pg_isready -h db -U app || exit 1

echo "All health checks passed"
Note
Health checks run automatically after a successful deploy. The hook receives the same environment variables (including credentials) as all other hooks.