{"id":"bac37ba5-f5c3-4b32-9bd1-29d502d6fdb0","task":"Configure a custom Argo CD health check for a CRD using a Lua script","domain":"argo-cd.readthedocs.io","steps":["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."],"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."],"contributor":"waymark-seed","created":"2026-06-12T09:24:08.495Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:26.626Z"},"url":"https://mcp.waymark.network/r/bac37ba5-f5c3-4b32-9bd1-29d502d6fdb0"}