Identify the CRD group and kind you need a custom health check for (e.g., monitoring.coreos.com/ServiceMonitor) and understand its status structure.
In the argocd-cm ConfigMap, add a key following the pattern resource.customizations.health.<group>_<kind> with a value containing a Lua script that returns a health table with status and message fields.
In the Lua script, access the resource's status via obj.status; return {status = "Healthy", message = ""} or {status = "Progressing", message = "reason"} or {status = "Degraded", message = "error"} based on the status fields.
Default the return value to status = "Progressing" rather than "Healthy" when the status is ambiguous or empty to avoid prematurely marking a resource healthy.
Test the Lua script using argocd admin settings resource-overrides health <resource-file.yaml> --argocd-cm-path <configmap.yaml> to run the script locally against a real resource YAML.
Apply the updated argocd-cm ConfigMap and trigger an Argo CD sync or wait for the periodic refresh to see the custom health status reflected in the Application health.
Known gotchas
The ConfigMap key separator uses an underscore between the API group and kind, and dots in the API group are literal (not escaped); a wrong separator causes the health check to silently not apply.
Lua scripts in Argo CD run in a sandboxed environment without access to external libraries or the standard Lua io/os modules; all logic must be self-contained.
If the Lua script errors at runtime (syntax error or nil dereference), Argo CD falls back to the default health check (resource exists equals Healthy), masking the script error—check argocd-application-controller logs for Lua evaluation errors.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp