diff --git a/values-global.yaml b/values-global.yaml index a5da491..ff75c7c 100644 --- a/values-global.yaml +++ b/values-global.yaml @@ -1,6 +1,7 @@ --- global: pattern: rhoso-gitops + singleArgoCD: true secretLoader: disabled: false secretStore: @@ -14,3 +15,281 @@ main: multiSourceConfig: enabled: true clusterGroupChartVersion: "0.9.*" + gitops: + customArgoYaml: | + resourceHealthChecks: + # This PVC check is the ClusterGroup chart default. It must be + # re-included here because Helm replaces the entire array when + # overridden in a downstream values file. + - kind: PersistentVolumeClaim + check: | + hs = {} + if obj.status ~= nil then + if obj.status.phase ~= nil then + if obj.status.phase == "Pending" then + hs.status = "Healthy" + hs.message = obj.status.phase + return hs + elseif obj.status.phase == "Bound" then + hs.status = "Healthy" + hs.message = obj.status.phase + return hs + end + end + end + hs.status = "Progressing" + hs.message = "Waiting for PVC" + return hs + # RHOSO resource health checks imported from + # openstack-k8s-operators/gitops argocd-openshift-gitops.yaml + - group: operators.coreos.com + kind: Subscription + check: | + hs = {} + hs.status = "Progressing" + hs.message = "" + -- UpgradePending is the normal steady state with Manual + -- installPlanApproval and startingCSV pinning: the operator + -- runs fine, an upgrade exists but is not approved. + -- Mapping to Progressing would break pinned deployments. + if obj.status ~= nil then + if obj.status.state ~= nil then + if obj.status.state == "AtLatestKnown" or obj.status.state == "UpgradePending" then + hs.message = obj.status.state .. " - " .. obj.status.currentCSV + hs.status = "Healthy" + end + end + end + return hs + - group: argoproj.io + kind: Application + check: | + hs = {} + hs.status = "Progressing" + hs.message = "" + if obj.status ~= nil then + if obj.status.health ~= nil then + hs.status = obj.status.health.status + if obj.status.health.message ~= nil then + hs.message = obj.status.health.message + end + end + end + return hs + - group: operator.openstack.org + kind: OpenStack + check: | + hs = {} + if obj.status ~= nil then + if obj.status.conditions ~= nil then + for i, condition in ipairs(obj.status.conditions) do + if condition.type == "OpenStackOperatorReadyCondition" 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 OpenStackOperator to be ready" + return hs + - group: nmstate.io + kind: NodeNetworkConfigurationPolicy + check: | + hs = {} + if obj.status ~= nil then + if obj.status.conditions ~= nil then + for i, condition in ipairs(obj.status.conditions) do + if condition.type == "Progressing" and condition.status == "True" then + hs.status = "Progressing" + hs.message = condition.message + return hs + end + if condition.type == "Degraded" and condition.status == "True" 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 NNCP to be SuccessfullyConfigured" + return hs + - group: metal3.io + kind: BareMetalHost + check: | + hs = {} + if obj.status ~= nil then + if obj.status.provisioning ~= nil then + if obj.status.provisioning.state ~= nil then + if obj.status.provisioning.state == "available" or obj.status.provisioning.state == "provisioned" then + hs.status = "Healthy" + hs.message = obj.status.provisioning.state + return hs + end + end + end + end + hs.status = "Progressing" + hs.message = "Waiting for BareMetalHost to be available or provisioned" + return hs + - group: baremetal.openstack.org + kind: OpenStackProvisionServer + check: | + hs = {} + if obj.status ~= nil then + if obj.status.conditions ~= nil then + for i, condition in ipairs(obj.status.conditions) do + if condition.type == "Ready" and condition.status == "False" then + hs.status = "Progressing" + 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 + end + end + hs.status = "Progressing" + hs.message = "Waiting for OpenStackProvisionServer to be Ready" + return hs + - group: core.openstack.org + kind: OpenStackControlPlane + check: | + hs = {} + if obj.status ~= nil then + if obj.status.conditions ~= nil then + for i, condition in ipairs(obj.status.conditions) do + if condition.type == "Ready" and condition.status == "False" then + hs.status = "Progressing" + 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 + end + end + hs.status = "Progressing" + hs.message = "Waiting for OpenStackControlPlane setup completion." + return hs + - group: dataplane.openstack.org + kind: OpenStackDataPlaneNodeSet + check: | + -- SetupReady = infrastructure configured, ready for + -- Ansible deployment. Overall Ready requires DeploymentReady + -- which only fires after a separate DataPlaneDeployment CR + -- completes (later sync wave). Using Ready here would + -- deadlock sync wave progression. + hs = {} + if obj.status ~= nil then + if obj.status.conditions ~= nil then + for i, condition in ipairs(obj.status.conditions) do + if condition.type == "SetupReady" 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 OpenStackDataPlaneNodeSet to be SetupReady." + return hs + - group: dataplane.openstack.org + kind: OpenStackDataPlaneDeployment + check: | + hs = {} + if obj.status ~= nil then + if obj.status.conditions ~= nil then + for i, condition in ipairs(obj.status.conditions) do + if condition.type == "Ready" 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 OpenStackDataPlaneDeployment to be Ready." + return hs + - group: external-secrets.io + kind: SecretStore + check: | + hs = {} + if obj.status ~= nil then + if obj.status.conditions ~= nil then + for i, condition in ipairs(obj.status.conditions) do + if condition.type == "Ready" 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 SecretStore to be Ready." + return hs + - group: secrets.hashicorp.com + kind: VaultConnection + check: | + hs = {} + hs.status = "Progressing" + hs.message = "Waiting for VaultConnection to be Valid." + if obj.status ~= nil then + if obj.status.valid ~= nil then + if obj.status.valid == true then + hs.status = "Healthy" + hs.message = "VaultConnection is valid" + end + end + end + return hs + - group: secrets.hashicorp.com + kind: VaultAuth + check: | + hs = {} + hs.status = "Progressing" + hs.message = "Waiting for VaultAuth to be Valid." + if obj.status ~= nil then + if obj.status.valid ~= nil then + if obj.status.valid == true then + hs.status = "Healthy" + hs.message = "VaultAuth is valid" + end + end + end + return hs + - group: operator.open-cluster-management.io + kind: MultiClusterHub + check: | + hs = {} + if obj.status ~= nil then + if obj.status.conditions ~= nil then + for i, condition in ipairs(obj.status.conditions) do + if condition.type == "Complete" 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 MultiClusterHub to be Complete." + return hs diff --git a/values-standalone.yaml b/values-standalone.yaml index cc59003..a03c149 100644 --- a/values-standalone.yaml +++ b/values-standalone.yaml @@ -25,280 +25,3 @@ clusterGroup: kind: Application jsonPointers: - /metadata/finalizers - argoCD: - resourceHealthChecks: - # This PVC check is the ClusterGroup chart default. It must be - # re-included here because Helm replaces the entire array when - # overridden in a downstream values file. - - kind: PersistentVolumeClaim - check: | - hs = {} - if obj.status ~= nil then - if obj.status.phase ~= nil then - if obj.status.phase == "Pending" then - hs.status = "Healthy" - hs.message = obj.status.phase - return hs - elseif obj.status.phase == "Bound" then - hs.status = "Healthy" - hs.message = obj.status.phase - return hs - end - end - end - hs.status = "Progressing" - hs.message = "Waiting for PVC" - return hs - # RHOSO resource health checks imported from - # openstack-k8s-operators/gitops argocd-openshift-gitops.yaml - - group: operators.coreos.com - kind: Subscription - check: | - hs = {} - hs.status = "Progressing" - hs.message = "" - -- UpgradePending is the normal steady state with Manual - -- installPlanApproval and startingCSV pinning: the operator - -- runs fine, an upgrade exists but is not approved. - -- Mapping to Progressing would break pinned deployments. - if obj.status ~= nil then - if obj.status.state ~= nil then - if obj.status.state == "AtLatestKnown" or obj.status.state == "UpgradePending" then - hs.message = obj.status.state .. " - " .. obj.status.currentCSV - hs.status = "Healthy" - end - end - end - return hs - - group: argoproj.io - kind: Application - check: | - hs = {} - hs.status = "Progressing" - hs.message = "" - if obj.status ~= nil then - if obj.status.health ~= nil then - hs.status = obj.status.health.status - if obj.status.health.message ~= nil then - hs.message = obj.status.health.message - end - end - end - return hs - - group: operator.openstack.org - kind: OpenStack - check: | - hs = {} - if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - if condition.type == "OpenStackOperatorReadyCondition" 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 OpenStackOperator to be ready" - return hs - - group: nmstate.io - kind: NodeNetworkConfigurationPolicy - check: | - hs = {} - if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - if condition.type == "Progressing" and condition.status == "True" then - hs.status = "Progressing" - hs.message = condition.message - return hs - end - if condition.type == "Degraded" and condition.status == "True" 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 NNCP to be SuccessfullyConfigured" - return hs - - group: metal3.io - kind: BareMetalHost - check: | - hs = {} - if obj.status ~= nil then - if obj.status.provisioning ~= nil then - if obj.status.provisioning.state ~= nil then - if obj.status.provisioning.state == "available" or obj.status.provisioning.state == "provisioned" then - hs.status = "Healthy" - hs.message = obj.status.provisioning.state - return hs - end - end - end - end - hs.status = "Progressing" - hs.message = "Waiting for BareMetalHost to be available or provisioned" - return hs - - group: baremetal.openstack.org - kind: OpenStackProvisionServer - check: | - hs = {} - if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - if condition.type == "Ready" and condition.status == "False" then - hs.status = "Progressing" - 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 - end - end - hs.status = "Progressing" - hs.message = "Waiting for OpenStackProvisionServer to be Ready" - return hs - - group: core.openstack.org - kind: OpenStackControlPlane - check: | - hs = {} - if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - if condition.type == "Ready" and condition.status == "False" then - hs.status = "Progressing" - 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 - end - end - hs.status = "Progressing" - hs.message = "Waiting for OpenStackControlPlane setup completion." - return hs - - group: dataplane.openstack.org - kind: OpenStackDataPlaneNodeSet - check: | - -- SetupReady = infrastructure configured, ready for - -- Ansible deployment. Overall Ready requires DeploymentReady - -- which only fires after a separate DataPlaneDeployment CR - -- completes (later sync wave). Using Ready here would - -- deadlock sync wave progression. - hs = {} - if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - if condition.type == "SetupReady" 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 OpenStackDataPlaneNodeSet to be SetupReady." - return hs - - group: dataplane.openstack.org - kind: OpenStackDataPlaneDeployment - check: | - hs = {} - if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - if condition.type == "Ready" 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 OpenStackDataPlaneDeployment to be Ready." - return hs - - group: external-secrets.io - kind: SecretStore - check: | - hs = {} - if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - if condition.type == "Ready" 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 SecretStore to be Ready." - return hs - - group: secrets.hashicorp.com - kind: VaultConnection - check: | - hs = {} - hs.status = "Progressing" - hs.message = "Waiting for VaultConnection to be Valid." - if obj.status ~= nil then - if obj.status.valid ~= nil then - if obj.status.valid == true then - hs.status = "Healthy" - hs.message = "VaultConnection is valid" - end - end - end - return hs - - group: secrets.hashicorp.com - kind: VaultAuth - check: | - hs = {} - hs.status = "Progressing" - hs.message = "Waiting for VaultAuth to be Valid." - if obj.status ~= nil then - if obj.status.valid ~= nil then - if obj.status.valid == true then - hs.status = "Healthy" - hs.message = "VaultAuth is valid" - end - end - end - return hs - - group: operator.open-cluster-management.io - kind: MultiClusterHub - check: | - hs = {} - if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - if condition.type == "Complete" 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 MultiClusterHub to be Complete." - return hs