You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Long Story short:
We need to build an external dashboard (for non tech people) that needs to provide the status of our argocd apps.
Those apps have a few peculiarities:
can be scaled down to 0 replica by a cronjob
can be disabled (it means the Deployment is not created)
In those 2 cases ArgoCD by default marks the application as Healthy, we wanted to change it to Suspended.
We correctly managed the the first case by adding a custom health check on Deployment (resource.customizations.health.apps_Deployment).
I thought managing the same would be pretty similar by creating a custom health check for argoproj.io_Application resources checking if a Deployment resource exists.
I actually implemented it but the App manifest doesn't mark the app as Suspended.
It marks instead the same (as you can see from the first screenshot) it as suspended in the AppOfApps application manifest
Here's the LUA script I used:
"resource.customizations.health.argoproj.io_Application" = <<-EOF
hs = {}
hs.status = "Progressing"
hs.message = ""
if obj.status ~= nil then
if obj.status.health ~= nil then
hs.status = obj.status.health.status
if obj.status.health.message ~= nil then
hs.message = obj.status.health.message
end
end
-- Check if the application has no resources
if obj.status.resources == nil then
hs.status = "Suspended"
hs.message = "No resources found"
-- Check if the application has no Deployment resources
else
local hasDeployment = false
for i, resource in ipairs(obj.status.resources) do
if resource.kind == "Deployment" and resource.status == "Synced" then
hasDeployment = true
break
end
end
if not hasDeployment then
hs.status = "Suspended"
hs.message = "Application has no Deployment resources"
end
end
end
return hs
EOF
Is there something obvious I am missing? I cannot figure out why ArgoCD correctly change the status of the App to suspended only when "looking at it" from the AppOfApps perspective.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Long Story short:
We need to build an external dashboard (for non tech people) that needs to provide the status of our argocd apps.
Those apps have a few peculiarities:
In those 2 cases ArgoCD by default marks the application as Healthy, we wanted to change it to Suspended.
We correctly managed the the first case by adding a custom health check on Deployment (resource.customizations.health.apps_Deployment).
I thought managing the same would be pretty similar by creating a custom health check for argoproj.io_Application resources checking if a Deployment resource exists.
I actually implemented it but the App manifest doesn't mark the app as Suspended.
It marks instead the same (as you can see from the first screenshot) it as suspended in the AppOfApps application manifest


Here's the LUA script I used:
Is there something obvious I am missing? I cannot figure out why ArgoCD correctly change the status of the App to suspended only when "looking at it" from the AppOfApps perspective.
ArgoCD version 3.1.5
Beta Was this translation helpful? Give feedback.
All reactions