diff --git a/bootstrap/eksctl/crossplane/argocd/argocd-values.yaml b/bootstrap/eksctl/crossplane/argocd/argocd-values.yaml index c80ded2c..7a74e291 100644 --- a/bootstrap/eksctl/crossplane/argocd/argocd-values.yaml +++ b/bootstrap/eksctl/crossplane/argocd/argocd-values.yaml @@ -12,8 +12,8 @@ controller: annotations: prometheus.io/scrape: true env: - - name: ARGOCD_K8S_CLIENT_QPS #required for Crossplane too many CRDs https://github.com/argoproj/argo-cd/pull/448 - value: "300" + - name: ARGOCD_K8S_CLIENT_QPS #required for Crossplane too many CRDs https://github.com/argoproj/argo-cd/pull/448 + value: "300" repoServer: autoscaling: @@ -21,8 +21,8 @@ repoServer: minReplicas: 1 resources: # Adjust based on your specific use case (required for HPA) requests: - cpu : "100m" - memory : "256Mi" + cpu: "100m" + memory: "256Mi" limits: cpu: "200m" memory: "512Mi" @@ -46,8 +46,8 @@ server: minReplicas: 1 resources: # Adjust based on your specific use case (required for HPA) requests: - cpu : "100m" - memory : "256Mi" + cpu: "100m" + memory: "256Mi" limits: cpu: "200m" memory: "512Mi" @@ -108,7 +108,8 @@ configs: end return health_status - "*.aws.upbound.io/*": + + "*.upbound.io/*": health.lua: | health_status = { status = "Progressing", @@ -144,10 +145,6 @@ configs: return health_status end - if obj.status == nil or obj.status.conditions == nil then - return health_status - end - for i, condition in ipairs(obj.status.conditions) do if condition.type == "LastAsyncOperation" then if condition.status == "False" then @@ -175,78 +172,8 @@ configs: end return health_status - "*.aws.crossplane.io/*": - health.lua: | - health_status = { - status = "Progressing", - message = "Provisioning ..." - } - - local function contains (table, val) - for i, v in ipairs(table) do - if v == val then - return true - end - end - return false - end - local has_no_status = { - "Composition", - "CompositionRevision", - "DeploymentRuntimeConfig", - "ControllerConfig", - "ProviderConfig", - "ProviderConfigUsage" - } - - if obj.status == nil or next(obj.status) == nil and contains(has_no_status, obj.kind) then - health_status.status = "Healthy" - health_status.message = "Resource is up-to-date." - return health_status - end - - if obj.status == nil or next(obj.status) == nil or obj.status.conditions == nil then - if obj.kind == "ProviderConfig" and obj.status.users ~= nil then - health_status.status = "Healthy" - health_status.message = "Resource is in use." - return health_status - end - return health_status - end - - if obj.status == nil or obj.status.conditions == nil then - return health_status - end - - for i, condition in ipairs(obj.status.conditions) do - if condition.type == "LastAsyncOperation" then - if condition.status == "False" then - health_status.status = "Degraded" - health_status.message = condition.message - return health_status - end - end - - if condition.type == "Synced" then - if condition.status == "False" then - health_status.status = "Degraded" - health_status.message = condition.message - return health_status - end - end - - if condition.type == "Ready" then - if condition.status == "True" then - health_status.status = "Healthy" - health_status.message = "Resource is up-to-date." - return health_status - end - end - end - - return health_status - "kubernetes.crossplane.io/*": + "*.crossplane.io/*": health.lua: | health_status = { status = "Progressing", @@ -270,7 +197,6 @@ configs: "ProviderConfig", "ProviderConfigUsage" } - if obj.status == nil or next(obj.status) == nil and contains(has_no_status, obj.kind) then health_status.status = "Healthy" health_status.message = "Resource is up-to-date." @@ -286,81 +212,6 @@ configs: return health_status end - if obj.status == nil or obj.status.conditions == nil then - return health_status - end - - for i, condition in ipairs(obj.status.conditions) do - if condition.type == "LastAsyncOperation" then - if condition.status == "False" then - health_status.status = "Degraded" - health_status.message = condition.message - return health_status - end - end - - if condition.type == "Synced" then - if condition.status == "False" then - health_status.status = "Degraded" - health_status.message = condition.message - return health_status - end - end - - if condition.type == "Ready" then - if condition.status == "True" then - health_status.status = "Healthy" - health_status.message = "Resource is up-to-date." - return health_status - end - end - end - - return health_status - "helm.crossplane.io/*": - health.lua: | - health_status = { - status = "Progressing", - message = "Provisioning ..." - } - - local function contains (table, val) - for i, v in ipairs(table) do - if v == val then - return true - end - end - return false - end - - local has_no_status = { - "Composition", - "CompositionRevision", - "DeploymentRuntimeConfig", - "ControllerConfig", - "ProviderConfig", - "ProviderConfigUsage" - } - - if obj.status == nil or next(obj.status) == nil and contains(has_no_status, obj.kind) then - health_status.status = "Healthy" - health_status.message = "Resource is up-to-date." - return health_status - end - - if obj.status == nil or next(obj.status) == nil or obj.status.conditions == nil then - if obj.kind == "ProviderConfig" and obj.status.users ~= nil then - health_status.status = "Healthy" - health_status.message = "Resource is in use." - return health_status - end - return health_status - end - - if obj.status == nil or obj.status.conditions == nil then - return health_status - end - for i, condition in ipairs(obj.status.conditions) do if condition.type == "LastAsyncOperation" then if condition.status == "False" then @@ -378,7 +229,7 @@ configs: end end - if condition.type == "Ready" then + if contains({"Ready", "Healthy", "Offered", "Established"}, condition.type) then if condition.status == "True" then health_status.status = "Healthy" health_status.message = "Resource is up-to-date." diff --git a/bootstrap/terraform/values/argocd.yaml b/bootstrap/terraform/values/argocd.yaml index e693d783..e575deb5 100644 --- a/bootstrap/terraform/values/argocd.yaml +++ b/bootstrap/terraform/values/argocd.yaml @@ -110,55 +110,40 @@ configs: end return health_status - %{ if crossplane_upjet_aws_provider_enable } - "*.aws.upbound.io/*": + + "*.upbound.io/*": health.lua: | health_status = { status = "Progressing", message = "Provisioning ..." } - if obj.status == nil or obj.status.conditions == nil then - return health_status - end - - for i, condition in ipairs(obj.status.conditions) do - if condition.type == "LastAsyncOperation" then - if condition.status == "False" then - health_status.status = "Degraded" - health_status.message = condition.message - return health_status - end - end - - if condition.type == "Synced" then - if condition.status == "False" then - health_status.status = "Degraded" - health_status.message = condition.message - return health_status - end - end - - if condition.type == "Ready" then - if condition.status == "True" then - health_status.status = "Healthy" - health_status.message = "Resource is up-to-date." - return health_status + local function contains (table, val) + for i, v in ipairs(table) do + if v == val then + return true end end + return false end - return health_status - %{endif} - %{ if crossplane_aws_provider_enable } - "*.aws.crossplane.io/*": - health.lua: | - health_status = { - status = "Progressing", - message = "Provisioning ..." + local has_no_status = { + "ProviderConfig", + "ProviderConfigUsage" } - if obj.status == nil or obj.status.conditions == nil then + if obj.status == nil or next(obj.status) == nil and contains(has_no_status, obj.kind) then + health_status.status = "Healthy" + health_status.message = "Resource is up-to-date." + return health_status + end + + if obj.status == nil or next(obj.status) == nil or obj.status.conditions == nil then + if obj.kind == "ProviderConfig" and obj.status.users ~= nil then + health_status.status = "Healthy" + health_status.message = "Resource is in use." + return health_status + end return health_status end @@ -189,16 +174,43 @@ configs: end return health_status - %{endif} - %{ if crossplane_kubernetes_provider_enable } - "kubernetes.crossplane.io/*": + + "*.crossplane.io/*": health.lua: | health_status = { status = "Progressing", message = "Provisioning ..." } - if obj.status == nil or obj.status.conditions == nil then + local function contains (table, val) + for i, v in ipairs(table) do + if v == val then + return true + end + end + return false + end + + local has_no_status = { + "Composition", + "CompositionRevision", + "DeploymentRuntimeConfig", + "ControllerConfig", + "ProviderConfig", + "ProviderConfigUsage" + } + if obj.status == nil or next(obj.status) == nil and contains(has_no_status, obj.kind) then + health_status.status = "Healthy" + health_status.message = "Resource is up-to-date." + return health_status + end + + if obj.status == nil or next(obj.status) == nil or obj.status.conditions == nil then + if obj.kind == "ProviderConfig" and obj.status.users ~= nil then + health_status.status = "Healthy" + health_status.message = "Resource is in use." + return health_status + end return health_status end @@ -219,7 +231,7 @@ configs: end end - if condition.type == "Ready" then + if contains({"Ready", "Healthy", "Offered", "Established"}, condition.type) then if condition.status == "True" then health_status.status = "Healthy" health_status.message = "Resource is up-to-date." @@ -229,4 +241,3 @@ configs: end return health_status - %{endif}