From f7da0568086b2786619c80b5b997c5a9528c971c Mon Sep 17 00:00:00 2001 From: YuChen Date: Fri, 22 Nov 2024 14:18:11 -0800 Subject: [PATCH] remove job and use nss for 4.5 recipes Signed-off-by: YuChen --- velero/backup/common-service/env.properties | 6 +- .../4.0-4.5-example-recipe-multi-ns.yaml | 108 ++++-------------- .../4.0-4.5-example-recipe-single-ns.yaml | 15 +-- ...4.7-example-recipe-multi-ns-multi-zen.yaml | 6 +- .../recipes/4.7-example-recipe-multi-ns.yaml | 4 +- .../recipes/4.7-example-recipe-single-ns.yaml | 4 +- 6 files changed, 33 insertions(+), 110 deletions(-) diff --git a/velero/backup/common-service/env.properties b/velero/backup/common-service/env.properties index 21cbda113..8a79729f0 100644 --- a/velero/backup/common-service/env.properties +++ b/velero/backup/common-service/env.properties @@ -1,13 +1,13 @@ # Change the following values to match your environment -OPERATOR_NS="" # Pass the namespace where the cs operator is installed +OPERATOR_NS="test-br" # Pass the namespace where the cs operator is installed # Pass the namespace where the cs services are installed # Leave it as empty string if the services are installed in the same namespace as the operator -SERVICES_NS="" +SERVICES_NS="test-br" CONTROL_NS="" # Pass the control namespace if it is needed to be backed up #Pass any additional namespaces in the tenant that are not the operator or services namespace. Comma delimited -TETHERED_NS="" +TETHERED_NS="tenant1,tenant2" # Change to the namespace where cert-manager, licensing and LSR are installed CERT_MANAGER_NAMESPACE="ibm-cert-manager" diff --git a/velero/spectrum-fusion/recipes/4.0-4.5-example-recipe-multi-ns.yaml b/velero/spectrum-fusion/recipes/4.0-4.5-example-recipe-multi-ns.yaml index 59d35b333..b4eeb02d7 100644 --- a/velero/spectrum-fusion/recipes/4.0-4.5-example-recipe-multi-ns.yaml +++ b/velero/spectrum-fusion/recipes/4.0-4.5-example-recipe-multi-ns.yaml @@ -93,35 +93,7 @@ spec: includedResourceTypes: - customresourcedefinitions.apiextensions.k8s.io labelSelector: foundationservices.cloudpak.ibm.com=crd - name: commonservice-crd - type: resource - - includeClusterResources: true - includedResourceTypes: - - deployments - - roles - - serviceaccounts - - rolebindings - - configmaps - labelSelector: foundationservices.cloudpak.ibm.com=cpfs-util-backup - name: setup-tenant-resources - type: resource - - includeClusterResources: true - includedResourceTypes: - - jobs - labelSelector: foundationservices.cloudpak.ibm.com=setup-tenant-job - name: setup-tenant-job-yaml - restoreStatus: - excludedResources: - - jobs - type: resource - - labelSelector: foundationservices.cloudpak.ibm.com=cpfs-util-backup - name: cpfs-util-volume - type: volume - - includeClusterResources: true - includedResourceTypes: - - customresourcedefinitions.apiextensions.k8s.io - labelSelector: foundationservices.cloudpak.ibm.com=crd - name: nss-crd + name: commonservices-crd type: resource - includedResourceTypes: - commonservices.operator.ibm.com @@ -129,9 +101,12 @@ spec: name: commonservice-cr type: resource - includedResourceTypes: + - roles + - rolebindings + - serviceaccounts - namespacescopes.operator.ibm.com labelSelector: foundationservices.cloudpak.ibm.com=nss - name: nss-cr + name: nss-resources type: resource - includedResourceTypes: - operandrequests.operator.ibm.com @@ -215,24 +190,24 @@ spec: timeout: 600 type: check - chks: - - condition: '{$.status.phase} == {"Running"}' + - condition: '{$.spec.replicas} == {$.status.readyReplicas}' name: podReady onError: fail - timeout: 1200 - labelSelector: app.kubernetes.io/name=operand-deployment-lifecycle-manager - name: odlm-check + timeout: 600 + name: nss-check + nameSelector: ibm-namespace-scope-operator namespace: onError: fail - selectResource: pod - timeout: 1200 + selectResource: deployment + timeout: 600 type: check - chks: - condition: '{$.status.phase} == {"Running"}' name: podReady onError: fail timeout: 600 - labelSelector: foundationservices.cloudpak.ibm.com=cpfs-util-backup - name: setup-tenant-check + labelSelector: app.kubernetes.io/name=operand-deployment-lifecycle-manager + name: odlm-check namespace: onError: fail selectResource: pod @@ -286,42 +261,6 @@ spec: selectResource: zen.cpd.ibm.com/v1/zenservice timeout: 1800 type: check - - labelSelector: foundationservices.cloudpak.ibm.com=cpfs-util-backup - name: setup-tenant - namespace: - onError: fail - ops: - - command: | - ["/bin/bash", "-c", "/cs-br/setup_tenant.sh --operator-namespace --services-namespace --tethered-namespaces --license-accept -c v -p <.spec.size value from commonservice cr> -i -s -n -v"] - container: cpfs-util - name: setup-tenant-command - timeout: 600 - selectResource: pod - type: exec - - labelSelector: foundationservices.cloudpak.ibm.com=cpfs-util-backup - name: setup-tenant-job - namespace: - onError: fail - ops: - - command: | - ["/bin/bash", "-c", "oc patch job setup-tenant-job -n --type=\"json\" -p '[{\"op\": \"remove\", \"path\":\"/spec/suspend\"}]'"] - container: cpfs-util - name: trigger-setup-tenant-job - timeout: 600 - selectResource: pod - type: exec - - chks: - - condition: '{$.status.phase} == {"Succeeded"}' - name: jobComplete - onError: fail - timeout: 600 - labelSelector: foundationservices.cloudpak.ibm.com=setup-tenant-job - name: setup-tenant-job-check - namespace: - onError: fail - selectResource: pod - timeout: 600 - type: check - chks: - condition: '{$.spec.replicas} == {$.status.readyReplicas}' name: podReady @@ -424,7 +363,6 @@ spec: - group: mongo-volume - group: mongo-deployment - hook: zen5-data/backup - - group: cpfs-util-volume - group: zen - group: zen-br-resources - group: common-services-namespace @@ -432,11 +370,10 @@ spec: - group: common-services-catalogs - group: common-services-operatorgroups - group: common-services-configmaps - - group: commonservice-crd + - group: commonservices-crd - group: commonservice-cr + - group: nss-resources - group: cs-operator-permissions - - group: setup-tenant-resources - - group: setup-tenant-job-yaml - group: singleton-subscriptions - group: cert-manager-resources - group: common-services-subscriptions @@ -453,22 +390,19 @@ spec: - group: ow-pull-secret - group: common-services-catalogs - group: common-services-operatorgroups - - group: common-services-configmaps - - group: commonservice-crd - group: cert-manager-crd - group: singleton-subscriptions - - group: commonservice-cr - hook: cert-manager-operator-check/podReady - hook: cert-manager-webhook-check/podReady - group: cert-manager-workload-resources - group: licensing-resources + # restore common services + - group: common-services-configmaps + - group: commonservices-crd + - group: commonservice-cr + - group: nss-resources - group: common-services-subscriptions - - group: cpfs-util-volume - - group: setup-tenant-resources - - group: setup-tenant-job-yaml - - hook: setup-tenant-check/podReady - - hook: setup-tenant-job/trigger-setup-tenant-job - - hook: setup-tenant-job-check/jobComplete + - hook: nss-check/podReady - hook: odlm-check/podReady - group: odlm-resources - group: operand-resources diff --git a/velero/spectrum-fusion/recipes/4.0-4.5-example-recipe-single-ns.yaml b/velero/spectrum-fusion/recipes/4.0-4.5-example-recipe-single-ns.yaml index 69ebb3f21..447ba7f27 100644 --- a/velero/spectrum-fusion/recipes/4.0-4.5-example-recipe-single-ns.yaml +++ b/velero/spectrum-fusion/recipes/4.0-4.5-example-recipe-single-ns.yaml @@ -95,22 +95,11 @@ spec: labelSelector: foundationservices.cloudpak.ibm.com=crd name: commonservice-crd type: resource - - includeClusterResources: true - includedResourceTypes: - - customresourcedefinitions.apiextensions.k8s.io - labelSelector: foundationservices.cloudpak.ibm.com=crd - name: nss-crd - type: resource - includedResourceTypes: - commonservices.operator.ibm.com labelSelector: foundationservices.cloudpak.ibm.com=commonservice name: commonservice-cr type: resource - - includedResourceTypes: - - namespacescopes.operator.ibm.com - labelSelector: foundationservices.cloudpak.ibm.com=nss - name: nss-cr - type: resource - includedResourceTypes: - operandrequests.operator.ibm.com labelSelector: foundationservices.cloudpak.ibm.com=operand @@ -177,13 +166,13 @@ spec: - condition: '{$.status.phase} == {"Running"}' name: podReady onError: fail - timeout: 1200 + timeout: 600 labelSelector: app.kubernetes.io/name=operand-deployment-lifecycle-manager name: odlm-check namespace: onError: fail selectResource: pod - timeout: 1200 + timeout: 600 type: check - chks: - condition: '{$.status.phase} == {"Running"}' diff --git a/velero/spectrum-fusion/recipes/4.7-example-recipe-multi-ns-multi-zen.yaml b/velero/spectrum-fusion/recipes/4.7-example-recipe-multi-ns-multi-zen.yaml index 4dbb65570..76f714576 100644 --- a/velero/spectrum-fusion/recipes/4.7-example-recipe-multi-ns-multi-zen.yaml +++ b/velero/spectrum-fusion/recipes/4.7-example-recipe-multi-ns-multi-zen.yaml @@ -259,13 +259,13 @@ spec: - condition: '{$.status.phase} == {"Running"}' name: podReady onError: fail - timeout: 1200 + timeout: 600 labelSelector: app.kubernetes.io/name=operand-deployment-lifecycle-manager name: odlm-check namespace: onError: fail selectResource: pod - timeout: 1200 + timeout: 600 type: check - chks: - condition: '{$.status.phase} == {"Running"}' @@ -543,7 +543,6 @@ spec: - group: ow-pull-secret - group: common-services-catalogs - group: common-services-operatorgroups - - group: common-services-configmaps - group: cert-manager-crd - group: license-service-reporter-crd - group: singleton-subscriptions @@ -560,6 +559,7 @@ spec: - hook: lsr-deployment/podReady - hook: lsr-data/restore # restore common services + - group: common-services-configmaps - group: commonservices-crd - group: commonservice-cr - group: nss-resources diff --git a/velero/spectrum-fusion/recipes/4.7-example-recipe-multi-ns.yaml b/velero/spectrum-fusion/recipes/4.7-example-recipe-multi-ns.yaml index 084717f32..22f98265e 100644 --- a/velero/spectrum-fusion/recipes/4.7-example-recipe-multi-ns.yaml +++ b/velero/spectrum-fusion/recipes/4.7-example-recipe-multi-ns.yaml @@ -259,13 +259,13 @@ spec: - condition: '{$.status.phase} == {"Running"}' name: podReady onError: fail - timeout: 1200 + timeout: 600 labelSelector: app.kubernetes.io/name=operand-deployment-lifecycle-manager name: odlm-check namespace: onError: fail selectResource: pod - timeout: 1200 + timeout: 600 type: check - chks: - condition: '{$.status.phase} == {"Running"}' diff --git a/velero/spectrum-fusion/recipes/4.7-example-recipe-single-ns.yaml b/velero/spectrum-fusion/recipes/4.7-example-recipe-single-ns.yaml index ba857dcff..6305ec1f4 100644 --- a/velero/spectrum-fusion/recipes/4.7-example-recipe-single-ns.yaml +++ b/velero/spectrum-fusion/recipes/4.7-example-recipe-single-ns.yaml @@ -236,13 +236,13 @@ spec: - condition: '{$.status.phase} == {"Running"}' name: podReady onError: fail - timeout: 1200 + timeout: 600 labelSelector: app.kubernetes.io/name=operand-deployment-lifecycle-manager name: odlm-check namespace: onError: fail selectResource: pod - timeout: 1200 + timeout: 600 type: check - chks: - condition: '{$.status.phase} == {"Running"}'