Uploaded image for project: 'OpenShift GitOps'
  1. OpenShift GitOps
  2. GITOPS-916

[ArgoCD]: Custom health check for DeploymentConfig resource

    • GITOPS Sprint 206

      As a user of Argo CD on OpenShift, I want to be able to use resources of type DeploymentConfig in my managed applications. However, I noticed that the health for a DeploymentConfig is always in Healthy state, no matter the real rollout status of the resource. This makes a DeploymentConfig resource useless in combination with sync waves, or PostSync hooks

      Acceptance criteria:

      • A custom health check is available for resources of type apps.openshift.io/DeploymentConfig which mimics behavior of the apps.Deployment check
      • The health checks reports a Progressing state if the rollout has not yet finished successfully
      • The health checks reports a Degraded state if the rollout deadline limit has been exceeded

            [GITOPS-916] [ArgoCD]: Custom health check for DeploymentConfig resource

            Ishita Sequeira added a comment -   PR:   https://github.com/argoproj/argo-cd/pull/7114  

            As it seems, someone came up with a custom resource health check for DeploymentConfig already, but has not submitted it for being included in Argo CD upstream:

                apps.openshift.io/DeploymentConfig:
                  health.lua: |
                    hs = {}
                    if obj.status ~= nil then
                      if obj.status.conditions ~= nil then
                        for i, condition in ipairs(obj.status.conditions) do
                          if condition.type == "Available" and condition.status == "False" then
                            hs.status = "Degraded"
                            hs.message = condition.message
                            return hs
                          end
                          if condition.type == "Available" and condition.status == "True" then
                            hs.status = "Healthy"
                            hs.message = condition.message
                            return hs
                          end
                        end
                      end
                    end
                    hs.status = "Progressing"
                    hs.message = "Waiting for rollout"
                    return hs
             

            Reference: https://github.com/argoproj/argo-cd/issues/5056

            I have not tested above example, but we can use that as a starting point.

            Jann Fischer added a comment - As it seems, someone came up with a custom resource health check for DeploymentConfig already, but has not submitted it for being included in Argo CD upstream: apps.openshift.io/DeploymentConfig: health.lua: | hs = {} if obj.status ~= nil then if obj.status.conditions ~= nil then for i, condition in ipairs(obj.status.conditions) do if condition.type == "Available" and condition.status == "False" then hs.status = "Degraded" hs.message = condition.message return hs end if condition.type == "Available" and condition.status == "True" then hs.status = "Healthy" hs.message = condition.message return hs end end end end hs.status = "Progressing" hs.message = "Waiting for rollout" return hs Reference: https://github.com/argoproj/argo-cd/issues/5056 I have not tested above example, but we can use that as a starting point.

              isequeir@redhat.com Ishita Sequeira
              jfischer@redhat.com Jann Fischer
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: