From 070c1a50045b85d457da1501c18f190232882611 Mon Sep 17 00:00:00 2001 From: Kuangyu Jing Date: Thu, 17 Jul 2025 03:07:34 +0900 Subject: [PATCH] Add ArgoCD health checks for Runner resources --- config/argocd/argocd-cm.yaml | 54 ++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 config/argocd/argocd-cm.yaml diff --git a/config/argocd/argocd-cm.yaml b/config/argocd/argocd-cm.yaml new file mode 100644 index 00000000..6779bca3 --- /dev/null +++ b/config/argocd/argocd-cm.yaml @@ -0,0 +1,54 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: argocd-cm + namespace: argocd +data: + # Add health check for legacy Runner + resource.customizations.health.actions.summerwind.dev_Runner: | + hs = {} + if obj.status ~= nil then + if obj.status.ready == true and obj.status.phase == "Running" then + hs.status = "Healthy" + hs.message = "Runner is ready and running" + elseif obj.status.phase == "Pending" or obj.status.phase == "Created" then + hs.status = "Progressing" + hs.message = "Runner is starting up" + elseif obj.status.phase == "Failed" then + hs.status = "Degraded" + hs.message = obj.status.message or "Runner has failed" + else + hs.status = "Progressing" + hs.message = "Runner status: " .. (obj.status.phase or "Unknown") + end + else + hs.status = "Progressing" + hs.message = "Waiting for runner status" + end + return hs + + # Add health check for EphemeralRunner + resource.customizations.health.actions.github.com_EphemeralRunner: | + hs = {} + if obj.status ~= nil then + if obj.status.phase == "Running" then + hs.status = "Healthy" + hs.message = "EphemeralRunner is running" + elseif obj.status.phase == "Pending" then + hs.status = "Progressing" + hs.message = "EphemeralRunner is pending" + elseif obj.status.phase == "Failed" then + hs.status = "Degraded" + hs.message = obj.status.message or "EphemeralRunner has failed" + elseif obj.status.phase == "Finished" then + hs.status = "Healthy" + hs.message = "EphemeralRunner has finished" + else + hs.status = "Progressing" + hs.message = "EphemeralRunner status: " .. (obj.status.phase or "Unknown") + end + else + hs.status = "Progressing" + hs.message = "Waiting for EphemeralRunner status" + end + return hs