This guide shows how to add a custom health check in Argo CD that validates a ConfigMap and influences the health status of an Argo CD Application. Argo CD includes many built-in health assessments for standard Kubernetes resources, but you can extend these checks by adding small Lua scripts to the Argo CD config (argocd-cm ConfigMap).Documentation Index
Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
Use this file to discover all available pages before exploring further.

How Argo CD custom health checks work
Custom health checks are Lua snippets stored in the argocd-cm ConfigMap under keys following a naming convention. Argo CD executes these scripts for matching resources and expects a table with at least astatus field (e.g., “Healthy”, “Degraded”, “Progressing”) and an optional message.
Key naming examples:
| Key format | Applies to | Example |
|---|---|---|
| resource.customizations.health.<apiGroup>_<Kind> | Resources in an API group | resource.customizations.health.argoproj.io_Application |
| resource.customizations.health.<Kind> | Core group resources | resource.customizations.health.ConfigMap |
Demo application overview
This demo repository contains an application namedhealth-check that demonstrates a ConfigMap-driven scenario:
- ConfigMap:
moving-shapes-colors— defines color values for shapes. - Deployment:
random-shapes— loads the ConfigMap viaenvFrom. - Service: exposes the application.
Create the Argo CD Application
Create an Argo CD Application that points to thehealth-check path in the git repo, targets the namespace health-check, and asks Argo CD to create the namespace. If you are not logged in to the argocd server the create command can fail — log in first if necessary.
Attempt to create the app (may fail if not logged in):

Sync the application and verify resources
Sync the application. Argo CD will create the namespace, then the ConfigMap, the Service, and finally the Deployment. The pod will initially show states like ContainerCreating / Progressing in the UI:
Add a custom health check for ConfigMap
In this demo the triangle becomes invisible whenTRIANGLE_COLOR is white. We’ll use that condition to mark the application as Degraded by adding a custom health check. Edit the argocd-cm ConfigMap in the argocd namespace and add a Lua snippet under the key resource.customizations.health.ConfigMap. The script below sets Degraded when TRIANGLE_COLOR equals white and returns a helpful message.
Custom health checks are Lua scripts executed by Argo CD. Be careful with Lua equality operators:
== tests equality, ~= tests inequality.moving-shapes-colors has TRIANGLE_COLOR set to white, Argo CD will evaluate the health hook and mark the ConfigMap (and the Application) as Degraded with the message you supplied (“Use any color other than white for TRIANGLE_COLOR”).
Resolve the degraded state
To resolve the degraded state, change theTRIANGLE_COLOR value either in the Git repo and sync, or edit the deployed ConfigMap directly and then restart pods if necessary so they pick up the change.
Example: edit the deployed ConfigMap in the health-check namespace:

Summary
- Add custom health checks by editing
argocd-cmand providing Lua scripts underresource.customizations.health.*. - Use
resource.customizations.health.ConfigMapto apply checks for core ConfigMap resources. - Argo CD executes these Lua checks and surfaces any custom
statusandmessagein the UI for the resource and its parent Application.
Links and references
- Argo CD Resource Health docs: https://argo-cd.readthedocs.io/en/stable/operator-manual/resource_customizations/
- Kubernetes Concepts: https://kubernetes.io/docs/concepts/overview/what-is-kubernetes/