ArgoCD has built-in health checks that can be created on most Kubernetes resources which then presents the status of the overall application as whole.
When it comes to Deployment, ReplicaSet, StatefulSet, and DaemonSet, it automatically checks by comparing the current state to the desired state.
Health check can vary in other resources:
status.loadBalancer.ingress
list is non-empty, with at least one value for hostname
or IP
status.loadBalancer.ingress
list is non-empty, with at least one value for hostname
or IP
.spec.suspended
is set to 'true', and mark the job and app health as suspendedstatus.phase
is BoundHealth checks are written inside the argocd-cm configmap using the Lua programming language. To focus on a specific resource define it by resource.customizations.health.<group/kind>
Example: edit or patch the argocd-cm file to add the following for a configmap check
data:
resource.customizations.health.ConfigMap: |
hs = {}
hs.status = "Healthy"
if obj.data.TRIANGLE_COLOR == "white" then
hs.status = "Degraded"
hs.message = "Use any color other than White "
end
return hs
This checks in all the configmaps of the application for the TRIANGLE_COLOR variable to see if its set to white and if so, it’ll make the application health status degraded