Argo-cd: Custom health assessments for CRDs

Created on 8 Dec 2018  路  4Comments  路  Source: argoproj/argo-cd

I was trying to set up cert-mananger and realized that Argo CD would benefit from being able to have some way of assessing health for custom CRD types.

In my case, my cert URL was invalid:

status:
  acme:
    uri: https://acme-staging-v02.api.letsencrypt.org/acme/acct/7529828
  conditions:
  - lastTransitionTime: "2018-12-08T09:24:29Z"
    message: Your ACME server URL is set to a v1 endpoint (https://acme-staging.api.letsencrypt.org/directory).
      You should update the spec.acme.server field to "https://acme-staging-v02.api.letsencrypt.org/directory"
    reason: InvalidConfig
    status: "False"
    type: Ready

I think we need a flexible way to allow users to provide some assess health heuristics of CRDs based on group/Kind. Maybe some jq expression

  1. [x] implement custom health support
  2. [x] health check for argoproj.io/Rollout
  3. [x] health check for certmanager.k8s.io/Issuer, certmanager.k8s.io/Certificate
  4. [x] document custom health checks

Most helpful comment

The direction we are going with customized health assessments is to have this configurable with embeddable Lua scripts that the user can configure in the argocd-cm configmap. Health assessment scripts would be made per group/Kind.

The reason for choosing Lua script (over something more familiar like javascript/typescript) is it's superior embedability. (Also read helm v3's rationale for choosing Lua: https://sweetcode.io/a-first-look-at-the-helm-3-plan/)

Argo CD will provide a built-in library of scripts for popular CRD types (such as cert-manager), to provide a good out-of-box experience, and welcome contributions from the community. Any built-in assessments can always be overridden by a script which is configured in the configmap.

All 4 comments

Alternatively, rather than a plugin mechanism, we could bake the health assessments directly into the health assessment library, starting with well known CRD types. Then rely on contributions to build up the library of health statuses. This would provide a more seamless experience, but is subject to breaking version changes,

A use case has come up where a user has Ingresses where status.loadBalancer will not be expected to be populated. Therefore, the ingress will always be Progressing, making the entire application "Progressing".

I think we should make the built-in types customizable as well, for when the built-in assessments are not what the user wants. This means we should employ a "plug-in" style of customized health assessments, which could even be applied to the built-in types.

The direction we are going with customized health assessments is to have this configurable with embeddable Lua scripts that the user can configure in the argocd-cm configmap. Health assessment scripts would be made per group/Kind.

The reason for choosing Lua script (over something more familiar like javascript/typescript) is it's superior embedability. (Also read helm v3's rationale for choosing Lua: https://sweetcode.io/a-first-look-at-the-helm-3-plan/)

Argo CD will provide a built-in library of scripts for popular CRD types (such as cert-manager), to provide a good out-of-box experience, and welcome contributions from the community. Any built-in assessments can always be overridden by a script which is configured in the configmap.

Fixed

Was this page helpful?
0 / 5 - 0 ratings