Built-in Resource Health States
ArgoCD provides several built-in health checks, each indicating a different state of resource health:- Healthy: All associated resources are 100% healthy.
- Progressing: The resource is not fully healthy but may recover over time.
- Degraded: The resource has encountered a failure or cannot reach a healthy state promptly.
- Missing: The resource does not exist in the cluster.
- Suspended: The resource is paused or in a suspended state (for example, a paused deployment).
- Unknown: The health assessment has failed, resulting in an indeterminate status.
Specific Kubernetes Object Checks
ArgoCD includes health checks tailored for specific Kubernetes objects. Here are a few examples:- Secrets: For Kubernetes secrets, ArgoCD checks whether a service is of type LoadBalancer by ensuring the
loadbalancer.ingresslist is not empty and includes at least one hostname or IP. - Ingress Resources: Similar to services, it verifies that
status.loadBalancer.ingressis populated with at least one hostname or IP. - Persistent Volume Claims (PVCs): The health of a PVC is determined by examining its
status.phaseto ensure that it is properly bound to a persistent volume. - Deployments, ReplicaSets, StatefulSets, and DaemonSets: ArgoCD compares the observed generation with the desired generation and ensures that the number of updated replicas matches the desired state.
Custom Health Checks
In scenarios where a built-in health check for a specific resource is unavailable, ArgoCD allows you to create custom health checks. These checks can be defined using Lua—a lightweight scripting language—in a config map. This flexibility extends to any Kubernetes resource, including cron jobs, runtime classes, roles, secrets, namespaces, pods, and PVCs. Consider a scenario where you deploy a front-end application with three geometric shapes—a circle, a rectangle, and a triangle—displayed on a white background. The colors of these shapes are defined in a config map. For instance, the following configuration sets the triangle color to white:Without a custom health check, this config map is created without any warnings. However, since the triangle is white, it might blend into the white background, rendering it invisible to end users.
TRIANGLE_COLOR is set to white.
Below is an example of a custom health check configuration: