Configure a custom Argo CD health check for a CRD using a Lua script

domain: argo-cd.readthedocs.io · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Identify the CRD group and kind you need a custom health check for (e.g., monitoring.coreos.com/ServiceMonitor) and understand its status structure.
  2. 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.
  3. 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.
  4. Default the return value to status = "Progressing" rather than "Healthy" when the status is ambiguous or empty to avoid prematurely marking a resource healthy.
  5. 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.
  6. 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

Related routes

Configure an Argo CD ApplicationSet using the Pull Request generator to create a preview Application per open pull request in a GitHub repository
Argo CD · 6 steps · unrated
Configure an Argo CD ApplicationSet with the Matrix generator combining cluster and git generators to fan out applications across multiple clusters and directories
argo-cd.readthedocs.io · 5 steps · unrated
Implement Argo CD resource hooks (PreSync, Sync, PostSync, SyncFail) with retry policies to orchestrate database migrations before and health checks after an application deployment
Argo CD · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans