diff --git a/content/en/ecosystem/integrations/argocd.md b/content/en/ecosystem/integrations/argocd.md index fb12b4d..af79151 100644 --- a/content/en/ecosystem/integrations/argocd.md +++ b/content/en/ecosystem/integrations/argocd.md @@ -231,3 +231,403 @@ resource.customizations.health.Namespace: | hs.message = "Waiting for Namespace status" return hs ``` + +### CapsuleConfiguration Resource Health + +Reports health based on the `Ready` condition, with `observedGeneration` staleness detection. + +```yaml +resource.customizations.health.capsule.clastix.io_CapsuleConfiguration: | + hs = {} + if obj.status == nil or obj.status.conditions == nil then + hs.status = "Progressing" + hs.message = "Waiting for status" + return hs + end + + if obj.metadata.generation ~= nil and obj.status.observedGeneration ~= nil then + if obj.status.observedGeneration < obj.metadata.generation then + hs.status = "Progressing" + hs.message = "Waiting for reconciliation (generation mismatch)" + return hs + end + end + + for _, condition in ipairs(obj.status.conditions) do + if condition.type == "Ready" and condition.status == "False" then + hs.status = "Degraded" + hs.message = condition.message + return hs + end + if condition.type == "Ready" and condition.status == "True" then + hs.status = "Healthy" + hs.message = condition.message + return hs + end + end + + hs.status = "Progressing" + hs.message = "Waiting for Ready condition" + return hs +``` + +### TenantOwner Resource Health + +```yaml +resource.customizations.health.capsule.clastix.io_TenantOwner: | + hs = {} + if obj.status == nil or obj.status.conditions == nil then + hs.status = "Progressing" + hs.message = "Waiting for status" + return hs + end + + if obj.metadata.generation ~= nil and obj.status.observedGeneration ~= nil then + if obj.status.observedGeneration < obj.metadata.generation then + hs.status = "Progressing" + hs.message = "Waiting for reconciliation (generation mismatch)" + return hs + end + end + + for _, condition in ipairs(obj.status.conditions) do + if condition.type == "Ready" and condition.status == "False" then + hs.status = "Degraded" + hs.message = condition.message + return hs + end + if condition.type == "Ready" and condition.status == "True" then + hs.status = "Healthy" + hs.message = condition.message + return hs + end + end + + hs.status = "Progressing" + hs.message = "Waiting for Ready condition" + return hs +``` + +### ResourcePool Resource Health + +Reports `Degraded` when any resource is exhausted or not ready, and `Healthy` when the pool is active and within limits. + +```yaml +resource.customizations.health.capsule.clastix.io_ResourcePool: | + hs = {} + if obj.status == nil or obj.status.conditions == nil then + hs.status = "Progressing" + hs.message = "Waiting for status" + return hs + end + + if obj.metadata.generation ~= nil and obj.status.observedGeneration ~= nil then + if obj.status.observedGeneration < obj.metadata.generation then + hs.status = "Progressing" + hs.message = "Waiting for reconciliation (generation mismatch)" + return hs + end + end + + if obj.status.exhaustions ~= nil then + local exhausted = {} + for resource, _ in pairs(obj.status.exhaustions) do + table.insert(exhausted, resource) + end + if #exhausted > 0 then + hs.status = "Degraded" + hs.message = "Pool exhausted for: " .. table.concat(exhausted, ", ") + return hs + end + end + + for _, condition in ipairs(obj.status.conditions) do + if condition.type == "Ready" and condition.status == "False" then + hs.status = "Degraded" + hs.message = condition.message + return hs + end + if condition.type == "Ready" and condition.status == "True" then + hs.status = "Healthy" + hs.message = condition.message + return hs + end + end + + hs.status = "Progressing" + hs.message = "Waiting for Ready condition" + return hs +``` + +### ResourcePoolClaim Resource Health + +Reports `Suspended` when unbound (waiting for a pool), `Degraded` when not ready, and `Healthy` when bound and ready. + +```yaml +resource.customizations.health.capsule.clastix.io_ResourcePoolClaim: | + hs = {} + if obj.status == nil or obj.status.conditions == nil then + hs.status = "Progressing" + hs.message = "Waiting for status" + return hs + end + + if obj.metadata.generation ~= nil and obj.status.observedGeneration ~= nil then + if obj.status.observedGeneration < obj.metadata.generation then + hs.status = "Progressing" + hs.message = "Waiting for reconciliation (generation mismatch)" + return hs + end + end + + for _, condition in ipairs(obj.status.conditions) do + if condition.type == "Bound" and condition.status == "False" then + hs.status = "Suspended" + hs.message = condition.message + return hs + end + end + + for _, condition in ipairs(obj.status.conditions) do + if condition.type == "Ready" and condition.status == "False" then + hs.status = "Degraded" + hs.message = condition.message + return hs + end + if condition.type == "Ready" and condition.status == "True" then + hs.status = "Healthy" + hs.message = condition.message + return hs + end + end + + hs.status = "Progressing" + hs.message = "Waiting for Ready condition" + return hs +``` + +### CustomQuota Resource Health + +```yaml +resource.customizations.health.capsule.clastix.io_CustomQuota: | + hs = {} + if obj.status == nil or obj.status.conditions == nil then + hs.status = "Progressing" + hs.message = "Waiting for status" + return hs + end + + if obj.metadata.generation ~= nil and obj.status.observedGeneration ~= nil then + if obj.status.observedGeneration < obj.metadata.generation then + hs.status = "Progressing" + hs.message = "Waiting for reconciliation (generation mismatch)" + return hs + end + end + + for _, condition in ipairs(obj.status.conditions) do + if condition.type == "Ready" and condition.status == "False" then + hs.status = "Degraded" + hs.message = condition.message + return hs + end + if condition.type == "Ready" and condition.status == "True" then + hs.status = "Healthy" + hs.message = condition.message + return hs + end + end + + hs.status = "Progressing" + hs.message = "Waiting for Ready condition" + return hs +``` + +### GlobalCustomQuota Resource Health + +```yaml +resource.customizations.health.capsule.clastix.io_GlobalCustomQuota: | + hs = {} + if obj.status == nil or obj.status.conditions == nil then + hs.status = "Progressing" + hs.message = "Waiting for status" + return hs + end + + if obj.metadata.generation ~= nil and obj.status.observedGeneration ~= nil then + if obj.status.observedGeneration < obj.metadata.generation then + hs.status = "Progressing" + hs.message = "Waiting for reconciliation (generation mismatch)" + return hs + end + end + + for _, condition in ipairs(obj.status.conditions) do + if condition.type == "Ready" and condition.status == "False" then + hs.status = "Degraded" + hs.message = condition.message + return hs + end + if condition.type == "Ready" and condition.status == "True" then + hs.status = "Healthy" + hs.message = condition.message + return hs + end + end + + hs.status = "Progressing" + hs.message = "Waiting for Ready condition" + return hs +``` + +### TenantResource Resource Health + +```yaml +resource.customizations.health.capsule.clastix.io_TenantResource: | + hs = {} + if obj.status == nil or obj.status.conditions == nil then + hs.status = "Progressing" + hs.message = "Waiting for status" + return hs + end + + if obj.metadata.generation ~= nil and obj.status.observedGeneration ~= nil then + if obj.status.observedGeneration < obj.metadata.generation then + hs.status = "Progressing" + hs.message = "Waiting for reconciliation (generation mismatch)" + return hs + end + end + + for _, condition in ipairs(obj.status.conditions) do + if condition.type == "Ready" and condition.status == "False" then + hs.status = "Degraded" + hs.message = condition.message + return hs + end + if condition.type == "Ready" and condition.status == "True" then + hs.status = "Healthy" + hs.message = condition.message + return hs + end + end + + hs.status = "Progressing" + hs.message = "Waiting for Ready condition" + return hs +``` + +### GlobalTenantResource Resource Health + +```yaml +resource.customizations.health.capsule.clastix.io_GlobalTenantResource: | + hs = {} + if obj.status == nil or obj.status.conditions == nil then + hs.status = "Progressing" + hs.message = "Waiting for status" + return hs + end + + if obj.metadata.generation ~= nil and obj.status.observedGeneration ~= nil then + if obj.status.observedGeneration < obj.metadata.generation then + hs.status = "Progressing" + hs.message = "Waiting for reconciliation (generation mismatch)" + return hs + end + end + + for _, condition in ipairs(obj.status.conditions) do + if condition.type == "Ready" and condition.status == "False" then + hs.status = "Degraded" + hs.message = condition.message + return hs + end + if condition.type == "Ready" and condition.status == "True" then + hs.status = "Healthy" + hs.message = condition.message + return hs + end + end + + hs.status = "Progressing" + hs.message = "Waiting for Ready condition" + return hs +``` + +## Capsule Proxy + +The following health checks apply to [Capsule Proxy](https://github.com/projectcapsule/capsule-proxy) CRDs. + +### ProxySetting Resource Health + +```yaml +resource.customizations.health.capsule.clastix.io_ProxySetting: | + hs = {} + if obj.status == nil or obj.status.conditions == nil then + hs.status = "Progressing" + hs.message = "Waiting for status" + return hs + end + + if obj.metadata.generation ~= nil and obj.status.observedGeneration ~= nil then + if obj.status.observedGeneration < obj.metadata.generation then + hs.status = "Progressing" + hs.message = "Waiting for reconciliation (generation mismatch)" + return hs + end + end + + for _, condition in ipairs(obj.status.conditions) do + if condition.type == "Ready" and condition.status == "False" then + hs.status = "Degraded" + hs.message = condition.message + return hs + end + if condition.type == "Ready" and condition.status == "True" then + hs.status = "Healthy" + hs.message = condition.message + return hs + end + end + + hs.status = "Progressing" + hs.message = "Waiting for Ready condition" + return hs +``` + +### GlobalProxySettings Resource Health + +```yaml +resource.customizations.health.capsule.clastix.io_GlobalProxySettings: | + hs = {} + if obj.status == nil or obj.status.conditions == nil then + hs.status = "Progressing" + hs.message = "Waiting for status" + return hs + end + + if obj.metadata.generation ~= nil and obj.status.observedGeneration ~= nil then + if obj.status.observedGeneration < obj.metadata.generation then + hs.status = "Progressing" + hs.message = "Waiting for reconciliation (generation mismatch)" + return hs + end + end + + for _, condition in ipairs(obj.status.conditions) do + if condition.type == "Ready" and condition.status == "False" then + hs.status = "Degraded" + hs.message = condition.message + return hs + end + if condition.type == "Ready" and condition.status == "True" then + hs.status = "Healthy" + hs.message = condition.message + return hs + end + end + + hs.status = "Progressing" + hs.message = "Waiting for Ready condition" + return hs +```