diff --git a/api/v1/types.go b/api/v1/types.go index 8740c11df..531e7104f 100644 --- a/api/v1/types.go +++ b/api/v1/types.go @@ -323,9 +323,9 @@ type ContainerTemplate struct { // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="ComponentCred for velero component" ComponentCred []Credential `json:"credentials,omitempty" yaml:"credentials,omitempty"` - //DeployRestic is to enable/disable restic services - // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Deploy Restic for Application Mobility" - DeployRestic bool `json:"deployRestic,omitempty" yaml:"deployRestic,omitempty"` + //DeployNodeAgent is to enable/disable node-agent services + // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Deploy node-agent for Application Mobility" + DeployNodeAgent bool `json:"deployNodeAgent,omitempty" yaml:"deployNodeAgent,omitempty"` } // SnapshotClass struct diff --git a/config/crd/bases/storage.dell.com_containerstoragemodules.yaml b/config/crd/bases/storage.dell.com_containerstoragemodules.yaml index cb286ec0c..7829d79c0 100644 --- a/config/crd/bases/storage.dell.com_containerstoragemodules.yaml +++ b/config/crd/bases/storage.dell.com_containerstoragemodules.yaml @@ -107,8 +107,9 @@ spec: type: object type: object type: array - deployRestic: - description: DeployRestic is to enable/disable restic services + deployNodeAgent: + description: DeployNodeAgent is to enable/disable node-agent + services type: boolean enabled: description: Enabled is used to indicate wether or not to @@ -378,8 +379,9 @@ spec: type: object type: object type: array - deployRestic: - description: DeployRestic is to enable/disable restic services + deployNodeAgent: + description: DeployNodeAgent is to enable/disable node-agent + services type: boolean enabled: description: Enabled is used to indicate wether or not to @@ -670,8 +672,9 @@ spec: type: object type: object type: array - deployRestic: - description: DeployRestic is to enable/disable restic services + deployNodeAgent: + description: DeployNodeAgent is to enable/disable node-agent + services type: boolean enabled: description: Enabled is used to indicate wether or not to @@ -940,8 +943,9 @@ spec: type: object type: object type: array - deployRestic: - description: DeployRestic is to enable/disable restic services + deployNodeAgent: + description: DeployNodeAgent is to enable/disable node-agent + services type: boolean enabled: description: Enabled is used to indicate wether or not to @@ -1213,8 +1217,9 @@ spec: type: object type: object type: array - deployRestic: - description: DeployRestic is to enable/disable restic services + deployNodeAgent: + description: DeployNodeAgent is to enable/disable node-agent + services type: boolean enabled: description: Enabled is used to indicate wether or not to @@ -1512,8 +1517,8 @@ spec: type: object type: object type: array - deployRestic: - description: DeployRestic is to enable/disable restic + deployNodeAgent: + description: DeployNodeAgent is to enable/disable node-agent services type: boolean enabled: @@ -1801,8 +1806,8 @@ spec: type: object type: object type: array - deployRestic: - description: DeployRestic is to enable/disable restic + deployNodeAgent: + description: DeployNodeAgent is to enable/disable node-agent services type: boolean enabled: diff --git a/deploy/crds/storage.dell.com_containerstoragemodules.yaml b/deploy/crds/storage.dell.com_containerstoragemodules.yaml index dc5b5497c..15dad0c76 100644 --- a/deploy/crds/storage.dell.com_containerstoragemodules.yaml +++ b/deploy/crds/storage.dell.com_containerstoragemodules.yaml @@ -91,8 +91,8 @@ spec: type: object type: object type: array - deployRestic: - description: DeployRestic is to enable/disable restic services + deployNodeAgent: + description: DeployNodeAgent is to enable/disable node-agent services type: boolean enabled: description: Enabled is used to indicate wether or not to deploy a module @@ -291,8 +291,8 @@ spec: type: object type: object type: array - deployRestic: - description: DeployRestic is to enable/disable restic services + deployNodeAgent: + description: DeployNodeAgent is to enable/disable node-agent services type: boolean enabled: description: Enabled is used to indicate wether or not to deploy a module @@ -510,8 +510,8 @@ spec: type: object type: object type: array - deployRestic: - description: DeployRestic is to enable/disable restic services + deployNodeAgent: + description: DeployNodeAgent is to enable/disable node-agent services type: boolean enabled: description: Enabled is used to indicate wether or not to deploy a module @@ -708,8 +708,8 @@ spec: type: object type: object type: array - deployRestic: - description: DeployRestic is to enable/disable restic services + deployNodeAgent: + description: DeployNodeAgent is to enable/disable node-agent services type: boolean enabled: description: Enabled is used to indicate wether or not to deploy a module @@ -911,8 +911,8 @@ spec: type: object type: object type: array - deployRestic: - description: DeployRestic is to enable/disable restic services + deployNodeAgent: + description: DeployNodeAgent is to enable/disable node-agent services type: boolean enabled: description: Enabled is used to indicate wether or not to deploy a module @@ -1135,8 +1135,8 @@ spec: type: object type: object type: array - deployRestic: - description: DeployRestic is to enable/disable restic services + deployNodeAgent: + description: DeployNodeAgent is to enable/disable node-agent services type: boolean enabled: description: Enabled is used to indicate wether or not to deploy a module @@ -1344,8 +1344,8 @@ spec: type: object type: object type: array - deployRestic: - description: DeployRestic is to enable/disable restic services + deployNodeAgent: + description: DeployNodeAgent is to enable/disable node-agent services type: boolean enabled: description: Enabled is used to indicate wether or not to deploy a module diff --git a/operatorconfig/moduleconfig/application-mobility/v0.3.0/restic.yaml b/operatorconfig/moduleconfig/application-mobility/v0.3.0/node-agent.yaml similarity index 90% rename from operatorconfig/moduleconfig/application-mobility/v0.3.0/restic.yaml rename to operatorconfig/moduleconfig/application-mobility/v0.3.0/node-agent.yaml index a2178ba01..8990e2968 100644 --- a/operatorconfig/moduleconfig/application-mobility/v0.3.0/restic.yaml +++ b/operatorconfig/moduleconfig/application-mobility/v0.3.0/node-agent.yaml @@ -1,7 +1,7 @@ apiVersion: apps/v1 kind: DaemonSet metadata: - name: node-agent + name: application-mobility-node-agent namespace: labels: app.kubernetes.io/name: application-mobility-velero @@ -9,16 +9,16 @@ metadata: spec: selector: matchLabels: - name: node-agent + name: application-mobility-node-agent template: metadata: labels: - name: node-agent + name: application-mobility-node-agent app.kubernetes.io/name: application-mobility-velero app.kubernetes.io/instance: application-mobility spec: serviceAccountName: application-mobility-velero-server-service-account - #terminationGracePeriodSeconds: 3600 + terminationGracePeriodSeconds: 3600 volumes: - name: cloud-credentials secret: @@ -28,7 +28,7 @@ spec: path: /var/lib/kubelet/pods - name: scratch emptyDir: {} - #dnsPolicy: ClusterFirst + dnsPolicy: ClusterFirst securityContext: runAsUser: 0 containers: @@ -70,4 +70,3 @@ spec: limits: cpu: 2000m memory: 2024Mi ---- diff --git a/operatorconfig/moduleconfig/application-mobility/v0.3.0/velero-deployment.yaml b/operatorconfig/moduleconfig/application-mobility/v0.3.0/velero-deployment.yaml index 508e36842..7945d0dc1 100644 --- a/operatorconfig/moduleconfig/application-mobility/v0.3.0/velero-deployment.yaml +++ b/operatorconfig/moduleconfig/application-mobility/v0.3.0/velero-deployment.yaml @@ -151,7 +151,7 @@ spec: volumeMounts: - name: plugins mountPath: /plugins - - name: + - name: cloud-credentials mountPath: /credentials - name: scratch mountPath: /scratch @@ -172,13 +172,18 @@ spec: lifecycle: dnsPolicy: ClusterFirst initContainers: - - name: - image: + - name: + image: + volumeMounts: + - mountPath: /target + name: plugins + - name: + image: volumeMounts: - mountPath: /target name: plugins volumes: - - name: + - name: cloud-credentials secret: secretName: - name: plugins diff --git a/pkg/modules/application_mobility.go b/pkg/modules/application_mobility.go index d39705669..d00aa26b8 100644 --- a/pkg/modules/application_mobility.go +++ b/pkg/modules/application_mobility.go @@ -54,8 +54,8 @@ const ( VeleroCrdManifest = "velero-crds.yaml" //VeleroAccessManifest - filename where velero access with its contents VeleroAccessManifest = "velero-secret.yaml" - //ResticCrdManifest - filename of restic manifest for app-mobility - ResticCrdManifest = "restic.yaml" + //NodeAgentCrdManifest - filename of node-agent manifest for app-mobility + NodeAgentCrdManifest = "node-agent.yaml" //ControllerImg - image for app-mobility-controller ControllerImg = "" @@ -79,23 +79,27 @@ const ( // VeleroNamespace - namespace Velero is installed in VeleroNamespace = "" // ConfigProvider - configurations provider (csi/aws) - ConfigProvider = "" + ConfigProvider = "" // VeleroImage - Image for velero VeleroImage = "" // VeleroImagePullPolicy - image pull policy for velero VeleroImagePullPolicy = "" // VeleroAccess - Secret name for velero VeleroAccess = "" - //InitContainerName - Name of init container for velero - InitContainerName = "" - //InitContainerImage - Image of init container for velero - InitContainerImage = "" + //AWSInitContainerName - Name of init container for velero - aws + AWSInitContainerName = "" + //AWSInitContainerImage - Image of init container for velero -aws + AWSInitContainerImage = "" + //DELLInitContainerName - Name of init container for velero - dell + DELLInitContainerName = "" + //DELLInitContainerImage - Image of init container for velero - dell + DELLInitContainerImage = "" //AccessContents - contents of the object store secret AccessContents = "" - //AccessKeyID - contains the aws access key id - AccessKeyID = "" - //AccessKey - contains the aws access key - AccessKey = "" + //AKeyID - contains the aws access key id + AKeyID = "" + //AKey - contains the aws access key + AKey = "" // AppMobCtrlMgrComponent - component name in cr for app-mobility controller-manager AppMobCtrlMgrComponent = "application-mobility-controller-manager" @@ -142,11 +146,10 @@ func VeleroCrdDeploy(ctx context.Context, isDeleting bool, op utils.OperatorConf if err != nil { return err } - err = applyDeleteObjects(ctx, ctrlClient, yamlString, isDeleting) - if err != nil { - return err + er := applyDeleteObjects(ctx, ctrlClient, yamlString, isDeleting) + if er != nil { + return er } - return nil } @@ -437,8 +440,8 @@ func getCreateVeleroAccess(op utils.OperatorConfig, cr csmv1.ContainerStorageMod yamlString = strings.ReplaceAll(yamlString, VeleroNamespace, veleroNS) yamlString = strings.ReplaceAll(yamlString, VeleroAccess, credName) - yamlString = strings.ReplaceAll(yamlString, AccessKeyID, accessID) - yamlString = strings.ReplaceAll(yamlString, AccessKey, access) + yamlString = strings.ReplaceAll(yamlString, AKeyID, accessID) + yamlString = strings.ReplaceAll(yamlString, AKey, access) return yamlString, nil } @@ -448,7 +451,7 @@ func AppMobilityVelero(ctx context.Context, isDeleting bool, op utils.OperatorCo var useSnap bool var cleanUp bool - var restic bool + var nodeAgent bool credName := "" veleroNS := "" @@ -472,8 +475,8 @@ func AppMobilityVelero(ctx context.Context, isDeleting bool, op utils.OperatorCo if c.CleanUpCRDs { cleanUp = true } - if c.DeployRestic { - restic = true + if c.DeployNodeAgent { + nodeAgent = true } for _, env := range c.Envs { if strings.Contains(AppMobObjStoreSecretName, env.Name) { @@ -534,8 +537,8 @@ func AppMobilityVelero(ctx context.Context, isDeleting bool, op utils.OperatorCo } } - if restic { - yamlString4, err := getRestic(op, cr) + if nodeAgent { + yamlString4, err := getNodeAgent(op, cr) if err != nil { return err } @@ -570,8 +573,10 @@ func getVelero(op utils.OperatorConfig, cr csmv1.ContainerStorageModule) (string provider := "" veleroImg := "" veleroImgPullPolicy := "" - veleroInitContainerName := "" - veleroInitContainerImage := "" + veleroAWSInitContainerName := "" + veleroAWSInitContainerImage := "" + veleroDELLInitContainerName := "" + veleroDELLInitContainerImage := "" backupURL := "" objectSecretName := "" @@ -613,35 +618,26 @@ func getVelero(op utils.OperatorConfig, cr csmv1.ContainerStorageModule) (string } } } - switch provider { - case "aws": - for _, m := range cr.Spec.Modules { - for _, icontainer := range m.InitContainer { - if icontainer.Name == "velero-plugin-for-aws" { - veleroInitContainerName = icontainer.Name - veleroInitContainerImage = string(icontainer.Image) - } + for _, m := range cr.Spec.Modules { + for _, icontainer := range m.InitContainer { + if icontainer.Name == "velero-plugin-for-aws" { + veleroAWSInitContainerName = icontainer.Name + veleroAWSInitContainerImage = string(icontainer.Image) } - } - case "csi": - for _, m := range cr.Spec.Modules { - for _, icontainer := range m.InitContainer { - if icontainer.Name == "dell-custom-velero-plugin" { - veleroInitContainerName = icontainer.Name - veleroInitContainerImage = string(icontainer.Image) - - } + if icontainer.Name == "dell-custom-velero-plugin" { + veleroDELLInitContainerName = icontainer.Name + veleroDELLInitContainerImage = string(icontainer.Image) } } - default: - fmt.Println("Invalid entry for config provider") } yamlString = strings.ReplaceAll(yamlString, VeleroNamespace, veleroNS) yamlString = strings.ReplaceAll(yamlString, VeleroImage, veleroImg) yamlString = strings.ReplaceAll(yamlString, VeleroImagePullPolicy, veleroImgPullPolicy) - yamlString = strings.ReplaceAll(yamlString, InitContainerName, veleroInitContainerName) - yamlString = strings.ReplaceAll(yamlString, InitContainerImage, veleroInitContainerImage) + yamlString = strings.ReplaceAll(yamlString, AWSInitContainerName, veleroAWSInitContainerName) + yamlString = strings.ReplaceAll(yamlString, AWSInitContainerImage, veleroAWSInitContainerImage) + yamlString = strings.ReplaceAll(yamlString, DELLInitContainerName, veleroDELLInitContainerName) + yamlString = strings.ReplaceAll(yamlString, DELLInitContainerImage, veleroDELLInitContainerImage) yamlString = strings.ReplaceAll(yamlString, BackupStorageLocation, backupStorageLocationName) yamlString = strings.ReplaceAll(yamlString, VeleroBucketName, bucketName) yamlString = strings.ReplaceAll(yamlString, BackupStorageURL, backupURL) @@ -728,15 +724,15 @@ func getCleanupcrds(op utils.OperatorConfig, cr csmv1.ContainerStorageModule) (s return yamlString, nil } -// getRestic - gets restic services manifests -func getRestic(op utils.OperatorConfig, cr csmv1.ContainerStorageModule) (string, error) { +// getNodeAgent - gets ndoe-agent services manifests +func getNodeAgent(op utils.OperatorConfig, cr csmv1.ContainerStorageModule) (string, error) { yamlString := "" appMob, err := getAppMobilityModule(cr) if err != nil { return yamlString, err } - cleanupCrdsPath := fmt.Sprintf("%s/moduleconfig/application-mobility/%s/%s", op.ConfigDirectory, appMob.ConfigVersion, ResticCrdManifest) + cleanupCrdsPath := fmt.Sprintf("%s/moduleconfig/application-mobility/%s/%s", op.ConfigDirectory, appMob.ConfigVersion, NodeAgentCrdManifest) buf, err := os.ReadFile(filepath.Clean(cleanupCrdsPath)) if err != nil { return yamlString, err @@ -746,19 +742,8 @@ func getRestic(op utils.OperatorConfig, cr csmv1.ContainerStorageModule) (string veleroNS := "" veleroImgPullPolicy := "" veleroImg := "" - credName := "" objectSecretName := "" - for _, component := range appMob.Components { - if component.Name == AppMobCtrlMgrComponent { - for _, env := range component.Envs { - if strings.Contains(AppMobObjStoreSecretName, env.Name) { - objectSecretName = env.Value - } - } - } - } - for _, component := range appMob.Components { if component.Name == AppMobVeleroComponent { if component.Image != "" { @@ -771,8 +756,8 @@ func getRestic(op utils.OperatorConfig, cr csmv1.ContainerStorageModule) (string if strings.Contains(VeleroNamespace, env.Name) { veleroNS = env.Value } - if strings.Contains(VeleroAccess, env.Name) { - credName = env.Value + if strings.Contains(AppMobObjStoreSecretName, env.Name) { + objectSecretName = env.Value } } @@ -788,9 +773,7 @@ func getRestic(op utils.OperatorConfig, cr csmv1.ContainerStorageModule) (string yamlString = strings.ReplaceAll(yamlString, VeleroImage, veleroImg) yamlString = strings.ReplaceAll(yamlString, VeleroNamespace, veleroNS) - yamlString = strings.ReplaceAll(yamlString, VeleroAccess, credName) yamlString = strings.ReplaceAll(yamlString, VeleroImagePullPolicy, veleroImgPullPolicy) - yamlString = strings.ReplaceAll(yamlString, AppMobObjStoreSecretName, objectSecretName) return yamlString, nil } diff --git a/pkg/modules/application_mobility_test.go b/pkg/modules/application_mobility_test.go index f5bd8748b..21509c1c6 100644 --- a/pkg/modules/application_mobility_test.go +++ b/pkg/modules/application_mobility_test.go @@ -49,7 +49,7 @@ func TestAppMobilityModuleDeployment(t *testing.T) { return true, true, tmpCR, sourceClient, operatorConfig }, "happy path": func(*testing.T) (bool, bool, csmv1.ContainerStorageModule, ctrlClient.Client, utils.OperatorConfig) { - customResource, err := getCustomResource("./testdata/cr_application_mobility_aws.yaml") + customResource, err := getCustomResource("./testdata/cr_application_mobility.yaml") if err != nil { panic(err) } @@ -434,7 +434,7 @@ func TestAppMobilityVelero(t *testing.T) { return false, false, tmpCR, sourceClient, operatorConfig }, "fail - app mob deployment file bad yaml": func(*testing.T) (bool, bool, csmv1.ContainerStorageModule, ctrlClient.Client, utils.OperatorConfig) { - customResource, err := getCustomResource("./testdata/cr_application_mobility_aws.yaml") + customResource, err := getCustomResource("./testdata/cr_application_mobility.yaml") if err != nil { panic(err) } diff --git a/pkg/modules/testdata/cr_application_mobility.yaml b/pkg/modules/testdata/cr_application_mobility.yaml index 5b62f6263..c4835c7f1 100644 --- a/pkg/modules/testdata/cr_application_mobility.yaml +++ b/pkg/modules/testdata/cr_application_mobility.yaml @@ -27,12 +27,7 @@ spec: # License for application mobility # Default value: license - name: "APPLICATION_MOBILITY_LICENSE_NAME" - value: "license" - - # Storage-service ingress configuration - # Default value: EMPTY - - name: "APPLICATION_MOBILITY_OBJECT_STORE_SECRET_NAME" - value: "cloud-credentials" + value: "license" # enabled: Enable/Disable cert-manager # Allowed values: @@ -48,8 +43,8 @@ spec: enabled: true useVolumeSnapshot: true cleanUpCRDs: true - # enabled: Enable/Disable Velero and Restic Services - deployRestic: true + # enabled: Enable/Disable node-agent service + deployNodeAgent: true envs: # Backup storage location name # Allowed values: string @@ -59,9 +54,9 @@ spec: # Velero bucket name # Allowed values: string - # Default value: default + # Default value: my-bucket - name: "BUCKET_NAME" - value: "velero-bucket" + value: "my-bucket" # Namespace for Velero installation # Default value: application-mobility @@ -69,34 +64,49 @@ spec: value: "application-mobility" # Based on the objectstore being used, the velero plugin and its configuration may need to change! - # default value: csi. Accepted values are csi, aws - - name: "PROVIDER" - value: "csi" + # default value: aws + - name: "CONFIGURATION_PROVIDER" + value: "aws" - # name is the name of the volume snapshot location where snapshots are being taken. Required. - # Volume-snapshot-Location Provider will be CONFIG_PROVIDER + # Name of the volume snapshot location where snapshots are being taken. Required. + # Volume-snapshot-Location Provider will be same as CONFIG_PROVIDER # Default value : default - name: "VOL_SNAPSHOT_LOCATION_NAME" value: "default" - + + # Name of the backup storage url + # This field has to be changed to a functional backup storage url + # Default value: localhost:8000 + - name: "BACKUP_STORAGE_URL" + value: "localhost:8000" + + # Name of the secret in velero namespace that has credentials to access object store + # We can leave the field empty if there no existing secret in velero installed namespace + # Default value: existing-cred + - name: "APPLICATION_MOBILITY_OBJECT_STORE_SECRET_NAME" + value: "existing-cred" + + #If velero is not already present in cluster, set enabled to true to create a secret. + #Either this or APPLICATION_MOBILITY_OBJECT_STORE_SECRET_NAME above must be provided. credentials: - enabled: true - #Optionally, specify the name to be used for secret that will be created to hold object store credentials. Used in conjunction with secretContents. + #Specify the name to be used for secret that will be created to hold object store credentials. name: cloud-creds - #Optionally, specify the object store access credentials to be stored in a secret with key "cloud". Either this or existingSecret should be provided. + #Specify the object store access credentials to be stored in a secret with key "cloud". secretContents: - #cloud: | - # [default] - # aws_access_key_id=access_key - # aws_secret_access_key=secret_access_key + aws_access_key_id: #Provide the access key id here + aws_secret_access_key: #provide the access key here + - # Init containers to add to the Velero deployment's pod spec. At least one plugin provider image is required. + # Init containers to be added to the Velero deployment's pod spec. # If the value is a string then it is evaluated as a template. - initContainer: - #initContainer image for the configuration-provider - csi + #initContainer image for the dell velero plugin - name: dell-custom-velero-plugin - image: dellemc/csm-application-mobility-velero-plugin:v0.1.0 + image: dellemc/csm-application-mobility-velero-plugin:latest - #initContainer image for the configuration-provider - aws + #initContainer image for the configuration provider aws - name: velero-plugin-for-aws - image: velero/velero-plugin-for-aws:v1.5.0 \ No newline at end of file + image: velero/velero-plugin-for-aws:v1.5.0 + + diff --git a/pkg/modules/testdata/cr_application_mobility_aws.yaml b/pkg/modules/testdata/cr_application_mobility_aws.yaml deleted file mode 100644 index f7c592d25..000000000 --- a/pkg/modules/testdata/cr_application_mobility_aws.yaml +++ /dev/null @@ -1,104 +0,0 @@ -apiVersion: storage.dell.com/v1 -kind: ContainerStorageModule -metadata: - name: application-mobility - namespace: application-mobility -spec: - modules: - # Application Mobility: enable csm-application-mobility module - - name: application-mobility - # enable: Enable/Disable app-mobility controller - enabled: true - configVersion: v0.3.0 - forceRemoveModule: true - components: - - name: application-mobility-controller-manager - # enable: Enable/Disable application mobility controller-manager - enabled: true - image: dellemc/csm-application-mobility-controller:v0.3.0 - imagePullPolicy: IfNotPresent - envs: - # Replica count for application mobility - # Allowed values: string - # Default value: 1 - - name: "APPLICATION_MOBILITY_REPLICA_COUNT" - value: "1" - - # License for application mobility - # Default value: license - - name: "APPLICATION_MOBILITY_LICENSE_NAME" - value: "license" - - # Storage-service ingress configuration - # Default value: EMPTY - - name: "APPLICATION_MOBILITY_OBJECT_STORE_SECRET_NAME" - value: "cloud-credentials" - - # enabled: Enable/Disable cert-manager - # Allowed values: - # true: enable deployment of cert-manager - # false: disable deployment of cert-manager only if it's already deployed - # Default value: false - - name: cert-manager - enabled: true - # enabled: Enable/Disable Velero - - name: velero - image: velero/velero:v1.10.0 - imagePullPolicy: IfNotPresent - enabled: true - useVolumeSnapshot: false - cleanUpCRDs: false - # enabled: Enable/Disable Restic Service - #deployRestic: false - envs: - # Backup storage location name - # Allowed values: string - # Default value: default - - name: "BACKUPSTORAGELOCATION_NAME" - value: "default" - - # Velero bucket name - # Allowed values: string - # Default value: default - - name: "BUCKET_NAME" - value: "velero-bucket" - - # Namespace for Velero installation - # Default value: application-mobility - - name: "VELERO_NAMESPACE" - value: "application-mobility" - - # Based on the objectstore being used, the velero plugin and its configuration may need to change! - # default value: csi. Accepted values are csi, aws - - name: "PROVIDER" - value: "aws" - - # name is the name of the volume snapshot location where snapshots are being taken. Required. - # Volume-snapshot-Location Provider will be CONFIG_PROVIDER - # Default value : default - - name: "VOL_SNAPSHOT_LOCATION_NAME" - value: "default" - - credentials: - - enabled: false - #Optionally, specify the name to be used for secret that will be created to hold object store credentials. Used in conjunction with secretContents. - name: cloud-creds - #Optionally, specify the object store access credentials to be stored in a secret with key "cloud". Either this or existingSecret should be provided. - secretContents: - #cloud: | - # [default] - # aws_access_key_id=access_key - # aws_secret_access_key=secret_access_key - - # Init containers to add to the Velero deployment's pod spec. At least one plugin provider image is required. - # If the value is a string then it is evaluated as a template. - - initContainer: - #initContainer image for the configuration-provider - csi - - name: dell-custom-velero-plugin - image: dellemc/csm-application-mobility-velero-plugin:v0.1.0 - - #initContainer image for the configuration-provider - aws - - name: velero-plugin-for-aws - image: velero/velero-plugin-for-aws:v1.5.0 - - diff --git a/samples/application-mobility/csm_application_mobility_v030.yaml b/samples/application-mobility/csm_application_mobility_v030.yaml index 79d52b839..6214fe29a 100644 --- a/samples/application-mobility/csm_application_mobility_v030.yaml +++ b/samples/application-mobility/csm_application_mobility_v030.yaml @@ -43,8 +43,8 @@ spec: enabled: true useVolumeSnapshot: false cleanUpCRDs: false - # enabled: Enable/Disable Velero and Restic Services - deployRestic: true + # enabled: Enable/Disable node-agent service + deployNodeAgent: true envs: # Backup storage location name # Allowed values: string @@ -65,11 +65,11 @@ spec: # Based on the objectstore being used, the velero plugin and its configuration may need to change! # default value: aws - - name: "PROVIDER" + - name: "CONFIGURATION_PROVIDER" value: "aws" # Name of the volume snapshot location where snapshots are being taken. Required. - # Volume-snapshot-Location Provider will be same as CONFIG_PROVIDER + # Volume-snapshot-Location Provider will be same as CONFIGURATION_PROVIDER # Default value : default - name: "VOL_SNAPSHOT_LOCATION_NAME" value: "default" @@ -98,14 +98,14 @@ spec: aws_secret_access_key: #provide the access key here - # Init containers to add to the Velero deployment's pod spec. At least one plugin provider image is required. + # Init containers to be added to the Velero deployment's pod spec. # If the value is a string then it is evaluated as a template. - initContainer: - #initContainer image for the configuration-provider - csi + #initContainer image for the dell velero plugin - name: dell-custom-velero-plugin - image: dellemc/csm-application-mobility-velero-plugin:v0.1.0 + image: dellemc/csm-application-mobility-velero-plugin:latest - #initContainer image for the configuration-provider - aws + #initContainer image for the configuration provider aws - name: velero-plugin-for-aws image: velero/velero-plugin-for-aws:v1.5.0 diff --git a/tests/e2e/go.sum b/tests/e2e/go.sum index 324bcf553..1fb368299 100644 --- a/tests/e2e/go.sum +++ b/tests/e2e/go.sum @@ -252,8 +252,6 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWb github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU= -github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7kR0iZvM= github.com/onsi/ginkgo/v2 v2.12.0 h1:UIVDowFPwpg6yMUpPjGkYvf06K3RAiJXUhCxEwQVHRI= github.com/onsi/ginkgo/v2 v2.12.0/go.mod h1:ZNEzXISYlqpb8S36iN71ifqLi3vVD1rVJGvWRCJOUpQ= github.com/onsi/gomega v1.27.8 h1:gegWiwZjBsf2DgiSbf5hpokZ98JVDMcWkUiigk6/KXc= diff --git a/tests/e2e/steps/step_common.go b/tests/e2e/steps/step_common.go index 32d3d116d..f8f1ff24a 100644 --- a/tests/e2e/steps/step_common.go +++ b/tests/e2e/steps/step_common.go @@ -356,7 +356,7 @@ func checkApplicationMobilityPods(namespace string, k8sClient kubernetes.Interfa for _, pod := range allPods { podMsg, podRunning := arePodsRunning(pod) - if podRunning == false { + if podRunning == false && pod.Status.Phase != "Succeeded" { return fmt.Errorf("pod %s not running: %+v", pod.Name, podMsg) } } diff --git a/tests/e2e/steps/steps_def.go b/tests/e2e/steps/steps_def.go index 2cc1d92a0..e7e1c63b8 100644 --- a/tests/e2e/steps/steps_def.go +++ b/tests/e2e/steps/steps_def.go @@ -305,9 +305,6 @@ func (step *Step) validateModuleNotInstalled(res Resource, module string, crNumS case csmv1.Resiliency: return step.validateResiliencyNotInstalled(cr) - - //case csmv1.ApplicationMobility: - // return step.validateAppMobNotInstalled(cr) } } } @@ -863,7 +860,8 @@ func (step *Step) validateAuthorizationProxyServerNotInstalled(cr csmv1.Containe } func (step *Step) validateAppMobInstalled(cr csmv1.ContainerStorageModule) error { - time.Sleep(5 * time.Second) + //providing additional time to get appmob pods up to running + time.Sleep(10 * time.Second) instance := new(csmv1.ContainerStorageModule) if err := step.ctrlClient.Get(context.TODO(), client.ObjectKey{ Namespace: cr.Namespace, @@ -890,7 +888,7 @@ func (step *Step) validateAppMobInstalled(cr csmv1.ContainerStorageModule) error } // provide few seconds for cluster to settle down - time.Sleep(20 * time.Second) + time.Sleep(10 * time.Second) return nil } diff --git a/tests/e2e/testfiles/alt-velero-secret.yaml b/tests/e2e/testfiles/application-mobility-templates/alt-velero-secret.yaml similarity index 86% rename from tests/e2e/testfiles/alt-velero-secret.yaml rename to tests/e2e/testfiles/application-mobility-templates/alt-velero-secret.yaml index 71be23a65..5412b9f8d 100644 --- a/tests/e2e/testfiles/alt-velero-secret.yaml +++ b/tests/e2e/testfiles/application-mobility-templates/alt-velero-secret.yaml @@ -11,4 +11,4 @@ stringData: cloud: | [default] aws_access_key_id=access_key - aws_secret_access_key=secret_access_key + aws_secret_access_key=access_key123 diff --git a/tests/e2e/testfiles/velero-secret.yaml b/tests/e2e/testfiles/application-mobility-templates/existing-cred.yaml similarity index 80% rename from tests/e2e/testfiles/velero-secret.yaml rename to tests/e2e/testfiles/application-mobility-templates/existing-cred.yaml index 1def92e57..d6cda5483 100644 --- a/tests/e2e/testfiles/velero-secret.yaml +++ b/tests/e2e/testfiles/application-mobility-templates/existing-cred.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: Secret metadata: - name: cloud-creds + name: existing-cred namespace: application-mobility labels: app.kubernetes.io/name: application-mobility-velero @@ -11,4 +11,4 @@ stringData: cloud: | [default] aws_access_key_id=access_key - aws_secret_access_key=secret_access_key \ No newline at end of file + aws_secret_access_key=secret_access_key123 \ No newline at end of file diff --git a/tests/e2e/testfiles/appmob-values.yaml b/tests/e2e/testfiles/appmob-values.yaml index 8184ab952..f1b64f263 100644 --- a/tests/e2e/testfiles/appmob-values.yaml +++ b/tests/e2e/testfiles/appmob-values.yaml @@ -1,4 +1,4 @@ -- scenario: "Install App Mobility with Velero and Cert-Manager already installed" +- scenario: "Install App Mobility with all features enabled while Velero and Cert-Manager already installed" paths: - "testfiles/csm_application_mobility_vanilla.yaml" modules: @@ -20,19 +20,17 @@ run: - sh verify-app-mobility.sh -- scenario: "Install App Mobility Controller with different env variables than default" +- scenario: "Install App Mobility Controller manager with different env variables along with velero" paths: - "testfiles/csm_application_mobility_controller_diff_env.yaml" modules: steps: - "Given an environment with k8s or openshift, and CSM operator installed" - - "Install [velero]" - "Install [cert-manager]" - "Apply custom resource [1]" - "Validate [application-mobility] module from CR [1] is installed" #- "Run custom test" # Last two steps perform Clean Up - - "Uninstall [velero]" - "Uninstall [cert-manager]" - "Enable forceRemoveModule on CR [1]" - "Delete custom resource [1]" @@ -44,63 +42,29 @@ - scenario: "Install App Mobility Velero with different env variables than default" paths: + - "testfiles/application-mobility-templates/alt-velero-secret.yaml" - "testfiles/csm_application_mobility_velero_diff_env.yaml" modules: steps: - "Given an environment with k8s or openshift, and CSM operator installed" + - "Install [cert-manager]" - "Apply custom resource [1]" - - "Validate [application-mobility] module from CR [1] is installed" + - "Apply custom resource [2]" + - "Validate [application-mobility] module from CR [2] is installed" #- "Run custom test" # Last two steps perform Clean Up - "Uninstall [cert-manager]" - - "Enable forceRemoveModule on CR [1]" - - "Delete custom resource [1]" - customTest: - # name of custom test to run - name: verify app-mobility - run: - - sh verify-app-mobility.sh - -- scenario: "Install App Mobility with Cert-Manager" - paths: - - "testfiles/csm_application_mobility_cert_manager.yaml" - modules: - steps: - - "Given an environment with k8s or openshift, and CSM operator installed" - - "Install [velero]" - - "Apply custom resource [1]" - - "Validate [application-mobility] module from CR [1] is installed" - #- "Run custom test" - # Last two steps perform Clean Up - - "Uninstall [velero]" - - "Enable forceRemoveModule on CR [1]" - - "Delete custom resource [1]" - customTest: - # name of custom test to run - name: verify app-mobility - run: - - sh verify-app-mobility.sh - -- scenario: "Install App Mobility with Cert-Manager and Velero" - paths: - - "testfiles/csm_application_mobility_velero_with_cert.yaml" - modules: - steps: - - "Given an environment with k8s or openshift, and CSM operator installed" - - "Apply custom resource [1]" - - "Validate [application-mobility] module from CR [1] is installed" - #- "Run custom test" - # Last two steps perform Clean Up - - "Enable forceRemoveModule on CR [1]" + - "Enable forceRemoveModule on CR [2]" - "Delete custom resource [1]" + - "Delete custom resource [2]" customTest: # name of custom test to run name: verify app-mobility run: - sh verify-app-mobility.sh -- scenario: "Install App Mobility with velero when cert-manager is already installed" +- scenario: "Install App Mobility with velero not installed and cert-manager already installed on machine" paths: - "testfiles/csm_application_mobility_test_velero.yaml" modules: @@ -117,16 +81,13 @@ customTest: # name of custom test to run name: verify app-mobility - # Provide command-line argument to run. Ginkgo will run the command and return output - # The command should be accessible from e2e_test repo. The cert-csi path is supplied in the values file. - # Example: # ./hello_world.sh run: - sh verify-app-mobility.sh - scenario: "Install App Mobility with powerflex driver" paths: - - "testfiles/csm_application_mobility_velero_with_cert.yaml" + - "testfiles/csm_application_mobility_vanilla.yaml" - "testfiles/storage_csm_powerflex.yaml" modules: steps: @@ -146,10 +107,6 @@ customTest: # name of the custom test to run name: verify app-mobility - # Provide command-line argument to run. Ginkgo will run the command and return output - # The command should be accessible from e2e_test repo. The cert-csi path is supplied in the values file. - # Example: # ./hello_world.sh run: - sh verify-app-mobility.sh - diff --git a/tests/e2e/testfiles/csm_application_mobility_cert_manager.yaml b/tests/e2e/testfiles/csm_application_mobility_cert_manager.yaml index ac660a181..1aef83a35 100644 --- a/tests/e2e/testfiles/csm_application_mobility_cert_manager.yaml +++ b/tests/e2e/testfiles/csm_application_mobility_cert_manager.yaml @@ -27,12 +27,7 @@ spec: # License for application mobility # Default value: license - name: "APPLICATION_MOBILITY_LICENSE_NAME" - value: "license" - - # Storage-service ingress configuration - # Default value: velero-restic-credentials - - name: "APPLICATION_MOBILITY_OBJECT_STORE_SECRET_NAME" - value: "velero-restic-credentials" + value: "license" # enabled: Enable/Disable cert-manager # Allowed values: @@ -41,49 +36,75 @@ spec: # Default value: false - name: cert-manager enabled: true - # enabled: Enable/Disable Velero and Restic Services - # Allowed values: - # true: enable deployment of cert-manager - # false: disable deployment of cert-manager only if it's already deployed - # Default value: false + # enabled: Enable/Disable Velero - name: velero - #existingSecret: existing_secret_name - image: velero/velero:v1.8.1 + image: velero/velero:v1.10.0 imagePullPolicy: IfNotPresent - enabled: false - #use-volume-snapshots: false - #cleanUpCRDs: false - #deployRestic: false - #initContainers: - # - name: dell-custom-velero-plugin - # image: dellemc/csm-application-mobility-velero-plugin:v0.1.0 - # volumeMounts: - # - mountPath: /target - # name: plugins - # - name: velero-plugin-for-aws - # image: velero/velero-plugin-for-aws:v1.5.0 - # volumeMounts: - # - mountPath: /target - # name: plugins + enabled: true + useVolumeSnapshot: false + cleanUpCRDs: false + # enabled: Enable/Disable Restic Services + deployRestic: true envs: # Backup storage location name # Allowed values: string # Default value: default - name: "BACKUPSTORAGELOCATION_NAME" value: "default" + + # Velero bucket name + # Allowed values: string + # Default value: my-bucket + - name: "BUCKET_NAME" + value: "my-bucket" # Namespace for Velero installation # Default value: application-mobility - name: "VELERO_NAMESPACE" value: "application-mobility" - # Based on the objectstore being used , the velero plugin and its configuration may need to change! - # GCP and Azure plugins configuration are different. See more details at: https://github.com/vmware-tanzu/helm-charts/blob/main/charts/velero/README.md - # Sample value: aws - - name: "CONFIG_PROVIDER" + # Based on the objectstore being used, the velero plugin and its configuration may need to change! + # default value: aws + - name: "PROVIDER" value: "aws" - # name to be used for secret that will be created to hold object store credentials. Used in conjunction with secretContents - # Default value: cloud-creds - - name: "VELERO_SECRET" - value: "cloud-creds" + # Name of the volume snapshot location where snapshots are being taken. Required. + # Volume-snapshot-Location Provider will be same as CONFIG_PROVIDER + # Default value : default + - name: "VOL_SNAPSHOT_LOCATION_NAME" + value: "default" + + # Name of the backup storage url + # This field has to be changed to a functional backup storage url + # Default value: existing-cred + - name: "BACKUP_STORAGE_URL" + value: "localhost:8000" + + # Name of the secret in velero namespace that has credentials to access object store + # We can leave the field empty if there no existing secret in velero installed namespace + # Default value: existing-cred + - name: "APPLICATION_MOBILITY_OBJECT_STORE_SECRET_NAME" + value: "existing-cred" + + #If velero is not already present in cluster, set enabled to true to create a secret. + #Either this or APPLICATION_MOBILITY_OBJECT_STORE_SECRET_NAME above must be provided. + credentials: + - enabled: false + #Specify the name to be used for secret that will be created to hold object store credentials. + name: cloud-creds + #Specify the object store access credentials to be stored in a secret with key "cloud". + secretContents: + aws_access_key_id: #Provide the access key id here + aws_secret_access_key: #provide the access key here + + + # Init containers to add to the Velero deployment's pod spec. At least one plugin provider image is required. + # If the value is a string then it is evaluated as a template. + - initContainer: + #initContainer image for the configuration-provider - csi + - name: dell-custom-velero-plugin + image: dellemc/csm-application-mobility-velero-plugin:v0.1.0 + + #initContainer image for the configuration-provider - aws + - name: velero-plugin-for-aws + image: velero/velero-plugin-for-aws:v1.5.0 \ No newline at end of file diff --git a/tests/e2e/testfiles/csm_application_mobility_controller_diff_env.yaml b/tests/e2e/testfiles/csm_application_mobility_controller_diff_env.yaml index 6d6645b4b..5baf47ec9 100644 --- a/tests/e2e/testfiles/csm_application_mobility_controller_diff_env.yaml +++ b/tests/e2e/testfiles/csm_application_mobility_controller_diff_env.yaml @@ -27,7 +27,7 @@ spec: # License for application mobility # Default value: license - name: "APPLICATION_MOBILITY_LICENSE_NAME" - value: "alt-license" + value: "license" # enabled: Enable/Disable cert-manager # Allowed values: @@ -36,49 +36,75 @@ spec: # Default value: false - name: cert-manager enabled: false - # enabled: Enable/Disable Velero and Restic Services - # Allowed values: - # true: enable deployment of cert-manager - # false: disable deployment of cert-manager only if it's already deployed - # Default value: false + # enabled: Enable/Disable Velero - name: velero - #existingSecret: existing_secret_name - image: velero/velero:v1.8.1 + image: velero/velero:v1.10.0 imagePullPolicy: IfNotPresent - enabled: false - #use-volume-snapshots: false - #cleanUpCRDs: false - #deployRestic: false - #initContainers: - # - name: dell-custom-velero-plugin - # image: dellemc/csm-application-mobility-velero-plugin:v0.1.0 - # volumeMounts: - # - mountPath: /target - # name: plugins - # - name: velero-plugin-for-aws - # image: velero/velero-plugin-for-aws:v1.5.0 - # volumeMounts: - # - mountPath: /target - # name: plugins + enabled: true + useVolumeSnapshot: false + cleanUpCRDs: false + # enabled: Enable/Disable Restic Services + deployRestic: true envs: # Backup storage location name # Allowed values: string # Default value: default - name: "BACKUPSTORAGELOCATION_NAME" value: "default" + + # Velero bucket name + # Allowed values: string + # Default value: my-bucket + - name: "BUCKET_NAME" + value: "my-bucket" # Namespace for Velero installation # Default value: application-mobility - name: "VELERO_NAMESPACE" value: "application-mobility" - # Based on the objectstore being used , the velero plugin and its configuration may need to change! - # GCP and Azure plugins configuration are different. See more details at: https://github.com/vmware-tanzu/helm-charts/blob/main/charts/velero/README.md - # Sample value: aws - - name: "CONFIG_PROVIDER" + # Based on the objectstore being used, the velero plugin and its configuration may need to change! + # default value: aws + - name: "PROVIDER" value: "aws" - # name to be used for secret that will be created to hold object store credentials. Used in conjunction with secretContents - # Default value: cloud-creds - - name: "VELERO_SECRET" - value: "cloud-creds" + # Name of the volume snapshot location where snapshots are being taken. Required. + # Volume-snapshot-Location Provider will be same as CONFIG_PROVIDER + # Default value : default + - name: "VOL_SNAPSHOT_LOCATION_NAME" + value: "default" + + # Name of the backup storage url + # This field has to be changed to a functional backup storage url + # Default value: existing-cred + - name: "BACKUP_STORAGE_URL" + value: "localhost:8000" + + # Name of the secret in velero namespace that has credentials to access object store + # We can leave the field empty if there no existing secret in velero installed namespace + # Default value: existing-cred + - name: "APPLICATION_MOBILITY_OBJECT_STORE_SECRET_NAME" + value: "existing-cred" + + #If velero is not already present in cluster, set enabled to true to create a secret. + #Either this or APPLICATION_MOBILITY_OBJECT_STORE_SECRET_NAME above must be provided. + credentials: + - enabled: false + #Specify the name to be used for secret that will be created to hold object store credentials. + name: cloud-creds + #Specify the object store access credentials to be stored in a secret with key "cloud". + secretContents: + aws_access_key_id: #Provide the access key id here + aws_secret_access_key: #provide the access key here + + + # Init containers to add to the Velero deployment's pod spec. At least one plugin provider image is required. + # If the value is a string then it is evaluated as a template. + - initContainer: + #initContainer image for the configuration-provider - csi + - name: dell-custom-velero-plugin + image: dellemc/csm-application-mobility-velero-plugin:v0.1.0 + + #initContainer image for the configuration-provider - aws + - name: velero-plugin-for-aws + image: velero/velero-plugin-for-aws:v1.5.0 \ No newline at end of file diff --git a/tests/e2e/testfiles/csm_application_mobility_test_velero.yaml b/tests/e2e/testfiles/csm_application_mobility_test_velero.yaml index c3223606f..3714a88db 100644 --- a/tests/e2e/testfiles/csm_application_mobility_test_velero.yaml +++ b/tests/e2e/testfiles/csm_application_mobility_test_velero.yaml @@ -35,15 +35,15 @@ spec: # false: disable deployment of cert-manager only if it's already deployed # Default value: false - name: cert-manager - enabled: true + enabled: false # enabled: Enable/Disable Velero - name: velero image: velero/velero:v1.10.0 imagePullPolicy: IfNotPresent - enabled: false - useVolumeSnapshot: false - cleanUpCRDs: false - # enabled: Enable/Disable Velero and Restic Services + enabled: true + useVolumeSnapshot: true + cleanUpCRDs: true + # enabled: Enable/Disable Restic Services deployRestic: true envs: # Backup storage location name @@ -94,8 +94,8 @@ spec: name: cloud-creds #Specify the object store access credentials to be stored in a secret with key "cloud". secretContents: - aws_access_key_id: #Provide the access key id here - aws_secret_access_key: #provide the access key here + aws_access_key_id: keyid + aws_secret_access_key: key123 # Init containers to add to the Velero deployment's pod spec. At least one plugin provider image is required. @@ -108,5 +108,3 @@ spec: #initContainer image for the configuration-provider - aws - name: velero-plugin-for-aws image: velero/velero-plugin-for-aws:v1.5.0 - - diff --git a/tests/e2e/testfiles/csm_application_mobility_vanilla.yaml b/tests/e2e/testfiles/csm_application_mobility_vanilla.yaml index 2e3d6b956..ad4b763de 100644 --- a/tests/e2e/testfiles/csm_application_mobility_vanilla.yaml +++ b/tests/e2e/testfiles/csm_application_mobility_vanilla.yaml @@ -27,12 +27,7 @@ spec: # License for application mobility # Default value: license - name: "APPLICATION_MOBILITY_LICENSE_NAME" - value: "license" - - # Storage-service ingress configuration - # Default value: velero-restic-credentials - - name: "APPLICATION_MOBILITY_OBJECT_STORE_SECRET_NAME" - value: "velero-restic-credentials" + value: "license" # enabled: Enable/Disable cert-manager # Allowed values: @@ -40,51 +35,76 @@ spec: # false: disable deployment of cert-manager only if it's already deployed # Default value: false - name: cert-manager - enabled: false - # enabled: Enable/Disable Velero and Restic Services - # Allowed values: - # true: enable deployment of cert-manager - # false: disable deployment of cert-manager only if it's already deployed - # Default value: false + enabled: true + # enabled: Enable/Disable Velero - name: velero - #existingSecret: existing_secret_name - image: velero/velero:v1.8.1 + image: velero/velero:v1.10.0 imagePullPolicy: IfNotPresent - enabled: false - #use-volume-snapshots: false - #cleanUpCRDs: false - #deployRestic: false - #initContainers: - # - name: dell-custom-velero-plugin - # image: dellemc/csm-application-mobility-velero-plugin:v0.1.0 - # volumeMounts: - # - mountPath: /target - # name: plugins - # - name: velero-plugin-for-aws - # image: velero/velero-plugin-for-aws:v1.5.0 - # volumeMounts: - # - mountPath: /target - # name: plugins + enabled: true + useVolumeSnapshot: true + cleanUpCRDs: true + # enabled: Enable/Disable Restic Services + deployRestic: true envs: # Backup storage location name # Allowed values: string # Default value: default - name: "BACKUPSTORAGELOCATION_NAME" value: "default" + + # Velero bucket name + # Allowed values: string + # Default value: my-bucket + - name: "BUCKET_NAME" + value: "my-bucket" # Namespace for Velero installation # Default value: application-mobility - name: "VELERO_NAMESPACE" value: "application-mobility" - # Based on the objectstore being used , the velero plugin and its configuration may need to change! - # GCP and Azure plugins configuration are different. See more details at: https://github.com/vmware-tanzu/helm-charts/blob/main/charts/velero/README.md - # Sample value: aws - - name: "CONFIG_PROVIDER" + # Based on the objectstore being used, the velero plugin and its configuration may need to change! + # default value: aws + - name: "PROVIDER" value: "aws" - # name to be used for secret that will be created to hold object store credentials. Used in conjunction with secretContents - # Default value: cloud-creds - - name: "VELERO_SECRET" - value: "cloud-creds" + # Name of the volume snapshot location where snapshots are being taken. Required. + # Volume-snapshot-Location Provider will be same as CONFIG_PROVIDER + # Default value : default + - name: "VOL_SNAPSHOT_LOCATION_NAME" + value: "default" + + # Name of the backup storage url + # This field has to be changed to a functional backup storage url + # Default value: existing-cred + - name: "BACKUP_STORAGE_URL" + value: "localhost:8000" + + # Name of the secret in velero namespace that has credentials to access object store + # We can leave the field empty if there no existing secret in velero installed namespace + # Default value: existing-cred + - name: "APPLICATION_MOBILITY_OBJECT_STORE_SECRET_NAME" + value: "existing-cred" + + #If velero is not already present in cluster, set enabled to true to create a secret. + #Either this or APPLICATION_MOBILITY_OBJECT_STORE_SECRET_NAME above must be provided. + credentials: + - enabled: true + #Specify the name to be used for secret that will be created to hold object store credentials. + name: velero-cred + #Specify the object store access credentials to be stored in a secret with key "cloud". + secretContents: + aws_access_key_id: keyid + aws_secret_access_key: key123 + + + # Init containers to add to the Velero deployment's pod spec. At least one plugin provider image is required. + # If the value is a string then it is evaluated as a template. + - initContainer: + #initContainer image for the configuration-provider - csi + - name: dell-custom-velero-plugin + image: dellemc/csm-application-mobility-velero-plugin:v0.1.0 + #initContainer image for the configuration-provider - aws + - name: velero-plugin-for-aws + image: velero/velero-plugin-for-aws:v1.5.0 \ No newline at end of file diff --git a/tests/e2e/testfiles/csm_application_mobility_velero_diff_env.yaml b/tests/e2e/testfiles/csm_application_mobility_velero_diff_env.yaml index 777f3d55c..b819cb22f 100644 --- a/tests/e2e/testfiles/csm_application_mobility_velero_diff_env.yaml +++ b/tests/e2e/testfiles/csm_application_mobility_velero_diff_env.yaml @@ -22,12 +22,12 @@ spec: # Allowed values: string # Default value: 1 - name: "APPLICATION_MOBILITY_REPLICA_COUNT" - value: "2" + value: "1" # License for application mobility # Default value: license - name: "APPLICATION_MOBILITY_LICENSE_NAME" - value: "alt-license" + value: "license" # enabled: Enable/Disable cert-manager # Allowed values: @@ -43,20 +43,20 @@ spec: enabled: true useVolumeSnapshot: false cleanUpCRDs: false - # enabled: Enable/Disable Velero and Restic Services + # enabled: Enable/Disable Restic Services deployRestic: true envs: # Backup storage location name # Allowed values: string # Default value: default - name: "BACKUPSTORAGELOCATION_NAME" - value: "default" + value: "alt-backupname" # Velero bucket name # Allowed values: string # Default value: my-bucket - name: "BUCKET_NAME" - value: "my-bucket" + value: "my-alt-bucket" # Namespace for Velero installation # Default value: application-mobility @@ -66,30 +66,30 @@ spec: # Based on the objectstore being used, the velero plugin and its configuration may need to change! # default value: aws - name: "PROVIDER" - value: "aws" + value: "csi" # Name of the volume snapshot location where snapshots are being taken. Required. # Volume-snapshot-Location Provider will be same as CONFIG_PROVIDER # Default value : default - name: "VOL_SNAPSHOT_LOCATION_NAME" - value: "default" + value: "alt-vol-snapshot" # Name of the backup storage url # This field has to be changed to a functional backup storage url - # Default value: localhost:8000 + # Default value: existing-cred - name: "BACKUP_STORAGE_URL" - value: "localhost:8000" + value: "localhost:1000" # Name of the secret in velero namespace that has credentials to access object store # We can leave the field empty if there no existing secret in velero installed namespace # Default value: existing-cred - name: "APPLICATION_MOBILITY_OBJECT_STORE_SECRET_NAME" - value: "existing-cred" + value: "alt-cloud-cred" #If velero is not already present in cluster, set enabled to true to create a secret. #Either this or APPLICATION_MOBILITY_OBJECT_STORE_SECRET_NAME above must be provided. credentials: - - enabled: true + - enabled: false #Specify the name to be used for secret that will be created to hold object store credentials. name: cloud-creds #Specify the object store access credentials to be stored in a secret with key "cloud". @@ -108,5 +108,3 @@ spec: #initContainer image for the configuration-provider - aws - name: velero-plugin-for-aws image: velero/velero-plugin-for-aws:v1.5.0 - - diff --git a/tests/e2e/testfiles/values.yaml b/tests/e2e/testfiles/values.yaml index e26bbf3c9..d7bde84a5 100644 --- a/tests/e2e/testfiles/values.yaml +++ b/tests/e2e/testfiles/values.yaml @@ -1399,7 +1399,7 @@ run: - ./cert-csi test vio --sc unity --chainNumber 2 --chainLength 2 -- scenario: "Install App Mobility with Velero and Cert-Manager already installed" +- scenario: "Install App Mobility with all features enabled while Velero and Cert-Manager already installed" paths: - "testfiles/csm_application_mobility_vanilla.yaml" modules: @@ -1421,19 +1421,17 @@ run: - sh verify-app-mobility.sh -- scenario: "Install App Mobility Controller with different env variables than default" +- scenario: "Install App Mobility Controller manager with different env variables along with velero" paths: - "testfiles/csm_application_mobility_controller_diff_env.yaml" modules: steps: - "Given an environment with k8s or openshift, and CSM operator installed" - - "Install [velero]" - "Install [cert-manager]" - "Apply custom resource [1]" - "Validate [application-mobility] module from CR [1] is installed" - "Run custom test" # Last two steps perform Clean Up - - "Uninstall [velero]" - "Uninstall [cert-manager]" - "Enable forceRemoveModule on CR [1]" - "Delete custom resource [1]" @@ -1449,6 +1447,7 @@ modules: steps: - "Given an environment with k8s or openshift, and CSM operator installed" + - "Install [cert-manager]" - "Apply custom resource [1]" - "Validate [application-mobility] module from CR [1] is installed" @@ -1467,26 +1466,6 @@ paths: - "testfiles/csm_application_mobility_cert_manager.yaml" modules: - steps: - - "Given an environment with k8s or openshift, and CSM operator installed" - - "Install [velero]" - - "Apply custom resource [1]" - - "Validate [application-mobility] module from CR [1] is installed" - - "Run custom test" - # Last two steps perform Clean Up - - "Uninstall [velero]" - - "Enable forceRemoveModule on CR [1]" - - "Delete custom resource [1]" - customTest: - # name of custom test to run - name: verify app-mobility - run: - - sh verify-app-mobility.sh - -- scenario: "Install App Mobility with Cert-Manager and Velero" - paths: - - "testfiles/csm_application_mobility_velero_with_cert.yaml" - modules: steps: - "Given an environment with k8s or openshift, and CSM operator installed" - "Apply custom resource [1]" @@ -1501,7 +1480,7 @@ run: - sh verify-app-mobility.sh -- scenario: "Install App Mobility with velero not installed and cert-manager already installed on machine" +- scenario: "Install App Mobility with velero when cert-manager is already installed" paths: - "testfiles/csm_application_mobility_test_velero.yaml" modules: @@ -1518,47 +1497,32 @@ customTest: # name of custom test to run name: verify app-mobility - # Provide command-line argument to run. Ginkgo will run the command and return output - # The command should be accessible from e2e_test repo. The cert-csi path is supplied in the values file. - # Example: - # ./hello_world.sh run: - sh verify-app-mobility.sh -- scenario: "Install App Mobility with powerflex driver" +- scenario: "Install App Mobility with velero not installed and cert-manager already installed on machine" paths: - - "testfiles/csm_application_mobility_velero_with_cert.yaml" - - "testfiles/storage_csm_powerflex.yaml" + - "testfiles/csm_application_mobility_test_velero.yaml" modules: steps: - "Given an environment with k8s or openshift, and CSM operator installed" + - "Install [cert-manager]" - "Apply custom resource [1]" - "Validate [application-mobility] module from CR [1] is installed" - - "Create storageclass with name [op-e2e-vxflexos] and template [testfiles/powerflex-templates/powerflex-storageclass-template.yaml] for [pflex]" - - "Set up secret with template [testfiles/powerflex-templates/powerflex-secret-template.yaml] name [test-vxflexos-config] in namespace [test-vxflexos] for [pflex]" - - "Apply custom resource [2]" - - "Validate custom resource [2]" - - "Validate [powerflex] driver from CR [2] is installed" - "Run custom test" # Last two steps perform Clean UP - - "Restore template [testfiles/powerflex-templates/powerflex-secret-template.yaml] for [pflex]" - - "Restore template [testfiles/powerflex-templates/powerflex-storageclass-template.yaml] for [pflex]" + - "Uninstall [cert-manager]" - "Enable forceRemoveModule on CR [1]" - "Delete custom resource [1]" - - "Delete custom resource [2]" customTest: - # name of the custom test to run + # name of custom test to run name: verify app-mobility - # Provide command-line argument to run. Ginkgo will run the command and return output - # The command should be accessible from e2e_test repo. The cert-csi path is supplied in the values file. - # Example: - # ./hello_world.sh run: - sh verify-app-mobility.sh - scenario: "Install App Mobility with powerflex driver" paths: - - "testfiles/csm_application_mobility_velero_with_cert.yaml" + - "testfiles/csm_application_mobility_vanilla.yaml" - "testfiles/storage_csm_powerflex.yaml" modules: steps: @@ -1572,17 +1536,11 @@ - "Validate [powerflex] driver from CR [2] is installed" - "Run custom test" # Last two steps perform Clean UP - - "Restore template [testfiles/powerflex-templates/powerflex-secret-template.yaml] for [pflex]" - - "Restore template [testfiles/powerflex-templates/powerflex-storageclass-template.yaml] for [pflex]" - "Enable forceRemoveModule on CR [1]" - "Delete custom resource [1]" - "Delete custom resource [2]" customTest: # name of the custom test to run name: verify app-mobility - # Provide command-line argument to run. Ginkgo will run the command and return output - # The command should be accessible from e2e_test repo. The cert-csi path is supplied in the values file. - # Example: - # ./hello_world.sh run: - - sh verify-app-mobility.sh \ No newline at end of file + - sh verify-app-mobility.sh