Skip to main content

Overview

Argo CD provides built-in health checks for standard Kubernetes resources. For custom resources or specialized health logic, you can write custom health checks in Lua.
Built-in Health ChecksArgo CD includes health checks for:
  • Deployments, ReplicaSets, StatefulSets, DaemonSets
  • Services, Ingresses
  • Jobs, CronJobs
  • PersistentVolumeClaims
  • And more…

When to Use Custom Health Checks

Custom Resources

Add health checks for CRDs that Argo CD doesn’t recognize

Fix Known Issues

Override buggy health checks for resources stuck in Progressing state

Complex Logic

Implement sophisticated health determination based on resource conditions

Domain-Specific

Check health based on your application’s specific requirements

Health Status Values

Custom health checks must return one of these statuses:
Resource is healthy and operating normally.

Configuration Methods

Method 1: ConfigMap Configuration

Define health checks in the argocd-cm ConfigMap:
The customization key format is resource.customizations.health.<apiGroup>_<kind>.

Method 2: Contribute Built-in Check

Contribute health checks to the Argo CD repository:
1

Create Directory Structure

Follow the structure above in your fork of the Argo CD repository.
2

Write health.lua

Implement your health check logic.
3

Add Tests

Create health_test.yaml with test cases:
4

Run Tests

5

Submit PR

Submit your contribution following the contributing guide.

Writing Health Check Scripts

Basic Example

Condition-Based Check

Multiple Conditions

Wildcard Support

ConfigMap Wildcards

Match multiple resources with wildcards:
Wildcards only work with the resource.customizations key format. The resource.customizations.health.<group>_<kind> format doesn’t support wildcards.

Built-in Wildcards

For contributed health checks, use _ as wildcard in directory names:
Avoid Massive ScriptsDon’t write one huge script for many resources. Keep scripts resource-specific for maintainability.

Advanced Configuration

Enable Standard Lua Libraries

Standard Lua libraries are disabled by default for security. Enable only for trusted scripts.

Restore Application Health Check

The health check for argoproj.io/Application was removed in v1.8. Restore it for app-of-apps patterns:

Health Inheritance

Important ConceptResource health is NOT inherited from child resources—it’s calculated only from the resource’s own status.
The Deployment is healthy even though one ReplicaSet is unhealthy, because health is based only on the Deployment’s own status fields.

Application-Level Health

Argo CD Application health is the worst health of its immediate child resources: Priority (most to least healthy): Healthy → Suspended → Progressing → Missing → Degraded → Unknown
Example: If an App has a Missing resource and a Degraded resource, the App’s health will be Degraded.

Ignoring Resource Health

Exclude specific resources from affecting Application health:

Overriding Built-in Checks

You can override Go-based built-in health checks with Lua scripts. This is useful for:
  • Customizing behavior for your environment
  • Working around bugs in built-in checks
  • Adding more sophisticated logic
Built-in health checks exist for:
  • PersistentVolumeClaim, Pod, Service
  • APIService, DaemonSet, Deployment, ReplicaSet, StatefulSet
  • Workflow (Argo Workflows)
  • HorizontalPodAutoscaler
  • Job, Ingress

Testing Health Checks

Create comprehensive test coverage:

Best Practices

Return as soon as you determine the status—don’t process unnecessarily.
Include helpful context in the message:
Always check if fields exist before accessing:
When in doubt, return Progressing rather than Healthy:

Example: Crossplane Resource

Next Steps

Resource Actions

Define custom actions for resources

Config Management Plugins

Create custom config management plugins

Example Health Checks

Browse built-in health checks

Lua Documentation

Learn Lua scripting