diff --git a/Makefile b/Makefile index 7da779c6669..768b3566c20 100644 --- a/Makefile +++ b/Makefile @@ -709,7 +709,7 @@ else endif .PHONY: test-e2e -test-e2e: helm-package render-smoke-testdata-manifests ## Run E2E tests. +test-e2e: helm-package install-s3-csi-driver render-smoke-testdata-manifests ## Run E2E tests. $(MAKE) -e VERSION=$(VERSION) PROVIDER=$(PROVIDER) REGION=$(REGION) SECRET_ID=$(SECRET_ID) SECRET_KEY=$(SECRET_KEY) INIT_ENV=$(INIT_ENV) TEST_TYPE=$(TEST_TYPE) SKIP_CASE=$(SKIP_CASE) CONFIG_TYPE=$(CONFIG_TYPE) -C test/e2e run .PHONY: render-smoke-testdata-manifests-local diff --git a/test/e2e/testdata/smoketest/mongodb/09_backup_snapshot.yaml b/test/e2e/testdata/smoketest/mongodb/09_backup_snapshot.yaml deleted file mode 100644 index 755c4abcc14..00000000000 --- a/test/e2e/testdata/smoketest/mongodb/09_backup_snapshot.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: dataprotection.kubeblocks.io/v1alpha1 -kind: Backup -metadata: - labels: - app.kubernetes.io/instance: mongocluster - dataprotection.kubeblocks.io/backup-type: snapshot - name: backup-snapshot-mongocluster -spec: - backupPolicyName: mongodb-cluster-mongodb-backup-policy - backupType: snapshot \ No newline at end of file diff --git a/test/e2e/testdata/smoketest/mongodb/09_backup_volume_snapshot.yaml b/test/e2e/testdata/smoketest/mongodb/09_backup_volume_snapshot.yaml new file mode 100644 index 00000000000..4733c092488 --- /dev/null +++ b/test/e2e/testdata/smoketest/mongodb/09_backup_volume_snapshot.yaml @@ -0,0 +1,13 @@ +apiVersion: dataprotection.kubeblocks.io/v1alpha1 +kind: Backup +metadata: + name: backup-mongodb-cluster-snapshot +spec: + backupPolicyName: mongodb-cluster-mongodb-backup-policy + retentionPeriod: 7d + backupMethod: volume-snapshot + deletionPolicy: Delete +status: + duration: 60s + backupRepoName: my-repo + phase: Completed \ No newline at end of file diff --git a/test/e2e/testdata/smoketest/mongodb/10_backup_volume_snapshot_restore.yaml b/test/e2e/testdata/smoketest/mongodb/10_backup_volume_snapshot_restore.yaml new file mode 100644 index 00000000000..07cd7b37e5d --- /dev/null +++ b/test/e2e/testdata/smoketest/mongodb/10_backup_volume_snapshot_restore.yaml @@ -0,0 +1,30 @@ +--- +# Source: mongodb-cluster/templates/replicaset.yaml +apiVersion: apps.kubeblocks.io/v1alpha1 +kind: Cluster +metadata: + name: mongo-cluster-snapshot + annotations: + kubeblocks.io/restore-from-backup: '{"mongodb":{"name":"backup-mongodb-cluster-snapshot","namespace":"default","managementPolicy":"Parallel"}}' +spec: + clusterDefinitionRef: mongodb + clusterVersionRef: mongodb-5.0 + terminationPolicy: Halt + affinity: + topologyKeys: + - kubernetes.io/hostname + componentSpecs: + - name: mongodb + componentDefRef: mongodb + monitor: false + replicas: 3 + serviceAccountName: kb-mongodb-cluster + volumeClaimTemplates: + - name: data # ref clusterdefinition components.containers.volumeMounts.name + spec: + storageClassName: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 21Gi \ No newline at end of file diff --git a/test/e2e/testdata/smoketest/mongodb/11_backup_datafile.yaml b/test/e2e/testdata/smoketest/mongodb/11_backup_datafile.yaml new file mode 100644 index 00000000000..3c35a12a29f --- /dev/null +++ b/test/e2e/testdata/smoketest/mongodb/11_backup_datafile.yaml @@ -0,0 +1,13 @@ +apiVersion: dataprotection.kubeblocks.io/v1alpha1 +kind: Backup +metadata: + name: backup-mongodb-cluster +spec: + backupPolicyName: mongodb-cluster-mongodb-backup-policy + retentionPeriod: 7d + backupMethod: datafile + deletionPolicy: Delete +status: + duration: 60s + backupRepoName: my-repo + phase: Completed \ No newline at end of file diff --git a/test/e2e/testdata/smoketest/mongodb/10_backup_snapshot_restore.yaml b/test/e2e/testdata/smoketest/mongodb/12_backup_datafile_restore.yaml similarity index 77% rename from test/e2e/testdata/smoketest/mongodb/10_backup_snapshot_restore.yaml rename to test/e2e/testdata/smoketest/mongodb/12_backup_datafile_restore.yaml index af52d8260bd..fd4f3faee55 100644 --- a/test/e2e/testdata/smoketest/mongodb/10_backup_snapshot_restore.yaml +++ b/test/e2e/testdata/smoketest/mongodb/12_backup_datafile_restore.yaml @@ -3,12 +3,12 @@ apiVersion: apps.kubeblocks.io/v1alpha1 kind: Cluster metadata: - name: mongocluster-snapshot + name: mongo-cluster-datafile annotations: - kubeblocks.io/restore-from-backup: "{\"mongodb\":\"backup-snapshot-mongocluster\"}" + kubeblocks.io/restore-from-backup: '{"mongodb":{"name":"backup-mongodb-cluster","namespace":"default","managementPolicy":"Parallel"}}' spec: clusterDefinitionRef: mongodb - clusterVersionRef: mongodb-5.0.14 + clusterVersionRef: mongodb-5.0 terminationPolicy: Halt affinity: topologyKeys: diff --git a/test/e2e/testdata/smoketest/postgresql/00_postgresqlcluster.yaml b/test/e2e/testdata/smoketest/postgresql/00_postgresqlcluster.yaml index c80a01e158a..7cc5a015e94 100644 --- a/test/e2e/testdata/smoketest/postgresql/00_postgresqlcluster.yaml +++ b/test/e2e/testdata/smoketest/postgresql/00_postgresqlcluster.yaml @@ -6,7 +6,7 @@ metadata: name: kb-pg-cluster namespace: default labels: - helm.sh/chart: postgresql-cluster-0.7.0-alpha.0 + helm.sh/chart: postgresql-cluster-0.8.0-alpha.0 app.kubernetes.io/version: "14.8.0" app.kubernetes.io/instance: pg-cluster --- @@ -16,7 +16,7 @@ kind: ClusterRoleBinding metadata: name: kb-pg-cluster labels: - helm.sh/chart: postgresql-cluster-0.7.0-alpha.0 + helm.sh/chart: postgresql-cluster-0.8.0-alpha.0 app.kubernetes.io/version: "14.8.0" app.kubernetes.io/instance: pg-cluster roleRef: @@ -34,7 +34,7 @@ kind: RoleBinding metadata: name: kb-pg-cluster labels: - helm.sh/chart: postgresql-cluster-0.7.0-alpha.0 + helm.sh/chart: postgresql-cluster-0.8.0-alpha.0 app.kubernetes.io/version: "14.8.0" app.kubernetes.io/instance: pg-cluster roleRef: @@ -53,7 +53,7 @@ metadata: name: pg-cluster namespace: default labels: - helm.sh/chart: postgresql-cluster-0.7.0-alpha.0 + helm.sh/chart: postgresql-cluster-0.8.0-alpha.0 app.kubernetes.io/version: "14.8.0" app.kubernetes.io/instance: pg-cluster spec: diff --git a/test/e2e/testdata/smoketest/postgresql/11_backup_basebackup.yaml b/test/e2e/testdata/smoketest/postgresql/11_backup_basebackup.yaml new file mode 100644 index 00000000000..783af83d756 --- /dev/null +++ b/test/e2e/testdata/smoketest/postgresql/11_backup_basebackup.yaml @@ -0,0 +1,13 @@ +apiVersion: dataprotection.kubeblocks.io/v1alpha1 +kind: Backup +metadata: + name: backup-postgresql-cluster +spec: + backupPolicyName: pg-cluster-postgresql-backup-policy + retentionPeriod: 7d + backupMethod: pg-basebackup + deletionPolicy: Delete +status: + duration: 60s + backupRepoName: my-repo + phase: Completed \ No newline at end of file diff --git a/test/e2e/testdata/smoketest/postgresql/11_backup_snapshot.yaml b/test/e2e/testdata/smoketest/postgresql/11_backup_snapshot.yaml deleted file mode 100644 index 11bd397c8c0..00000000000 --- a/test/e2e/testdata/smoketest/postgresql/11_backup_snapshot.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: dataprotection.kubeblocks.io/v1alpha1 -kind: Backup -metadata: - labels: - app.kubernetes.io/instance: mycluster - dataprotection.kubeblocks.io/backup-type: snapshot - name: backup-snapshot-pg -spec: - backupPolicyName: pg-cluster-postgresql-backup-policy - backupType: snapshot \ No newline at end of file diff --git a/test/e2e/testdata/smoketest/postgresql/12_backup_basebackup_restore.yaml b/test/e2e/testdata/smoketest/postgresql/12_backup_basebackup_restore.yaml new file mode 100644 index 00000000000..8f9ad2b5cd9 --- /dev/null +++ b/test/e2e/testdata/smoketest/postgresql/12_backup_basebackup_restore.yaml @@ -0,0 +1,26 @@ +--- +# Source: postgresql-cluster/templates/cluster.yaml +apiVersion: apps.kubeblocks.io/v1alpha1 +kind: Cluster +metadata: + name: pg-cluster-snapshot + annotations: + kubeblocks.io/restore-from-backup: '{"postgresql":{"name":"backup-postgresql-cluster","namespace":"default","managementPolicy":"Parallel"}}' +spec: + clusterDefinitionRef: postgresql + clusterVersionRef: postgresql-14.7.2-latest + terminationPolicy: WipeOut + componentSpecs: + - name: postgresql + componentDefRef: postgresql + serviceAccountName: kb-mycluster-pgcluster + monitor: false + replicas: 1 + volumeClaimTemplates: + - name: data + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 21Gi \ No newline at end of file diff --git a/test/e2e/testdata/smoketest/postgresql/12_backup_snapshot_restore.yaml b/test/e2e/testdata/smoketest/postgresql/12_backup_snapshot_restore.yaml deleted file mode 100644 index b6d893dcf4d..00000000000 --- a/test/e2e/testdata/smoketest/postgresql/12_backup_snapshot_restore.yaml +++ /dev/null @@ -1,112 +0,0 @@ ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: kb-mycluster-pgcluster - labels: - helm.sh/chart: pgcluster-0.5.1-beta.3 - app.kubernetes.io/name: pgcluster - app.kubernetes.io/instance: mycluster - app.kubernetes.io/version: "14.7.1" - app.kubernetes.io/managed-by: Helm ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: kb-mycluster-pgcluster - namespace: default - labels: - helm.sh/chart: pgcluster-0.5.1-beta.3 - app.kubernetes.io/name: pgcluster - app.kubernetes.io/instance: mycluster - app.kubernetes.io/version: "14.7.1" - app.kubernetes.io/managed-by: Helm -rules: - - apiGroups: - - "" - resources: - - configmaps - verbs: - - create - - get - - list - - patch - - update - - watch - # delete is required only for 'patronictl remove' - - delete - - apiGroups: - - "" - resources: - - endpoints - verbs: - - get - - patch - - update - - create - - list - - watch - # delete is required only for 'patronictl remove' - - delete - - apiGroups: - - "" - resources: - - pods - verbs: - - get - - list - - patch - - update - - watch - - apiGroups: - - "" - resources: - - events - verbs: - - create ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: kb-mycluster-pgcluster - labels: - - helm.sh/chart: pgcluster-0.5.1-beta.3 - app.kubernetes.io/name: pgcluster - app.kubernetes.io/instance: mycluster - app.kubernetes.io/version: "14.7.1" - app.kubernetes.io/managed-by: Helm -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: kb-mycluster-pgcluster -subjects: - - kind: ServiceAccount - name: kb-mycluster-pgcluster - namespace: default ---- -# Source: postgresql-cluster/templates/cluster.yaml -apiVersion: apps.kubeblocks.io/v1alpha1 -kind: Cluster -metadata: - name: pg-cluster-snapshot - annotations: - kubeblocks.io/restore-from-backup: "{\"postgresql\":\"backup-snapshot-pg\"}" -spec: - clusterDefinitionRef: postgresql - clusterVersionRef: postgresql-14.7.2 - terminationPolicy: WipeOut - componentSpecs: - - name: postgresql - componentDefRef: postgresql - serviceAccountName: kb-mycluster-pgcluster - monitor: false - replicas: 1 - volumeClaimTemplates: - - name: data - spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 21Gi \ No newline at end of file diff --git a/test/e2e/testdata/smoketest/postgresql/13_backup_volume_snapshot.yaml b/test/e2e/testdata/smoketest/postgresql/13_backup_volume_snapshot.yaml new file mode 100644 index 00000000000..25ad14d9218 --- /dev/null +++ b/test/e2e/testdata/smoketest/postgresql/13_backup_volume_snapshot.yaml @@ -0,0 +1,13 @@ +apiVersion: dataprotection.kubeblocks.io/v1alpha1 +kind: Backup +metadata: + name: backup-postgresql-cluster-snapshot +spec: + backupPolicyName: pg-cluster-postgresql-backup-policy + retentionPeriod: 7d + backupMethod: volume-snapshot + deletionPolicy: Delete +status: + duration: 60s + backupRepoName: my-repo + phase: Completed \ No newline at end of file diff --git a/test/e2e/testdata/smoketest/postgresql/14_backup_volume_snapshot_restore.yaml b/test/e2e/testdata/smoketest/postgresql/14_backup_volume_snapshot_restore.yaml new file mode 100644 index 00000000000..63c56f97e1e --- /dev/null +++ b/test/e2e/testdata/smoketest/postgresql/14_backup_volume_snapshot_restore.yaml @@ -0,0 +1,26 @@ +--- +# Source: postgresql-cluster/templates/cluster.yaml +apiVersion: apps.kubeblocks.io/v1alpha1 +kind: Cluster +metadata: + name: pg-cluster-snapshot + annotations: + kubeblocks.io/restore-from-backup: '{"postgresql":{"name":"backup-postgresql-cluster-snapshot","namespace":"default","managementPolicy":"Parallel"}}' +spec: + clusterDefinitionRef: postgresql + clusterVersionRef: postgresql-14.7.2-latest + terminationPolicy: WipeOut + componentSpecs: + - name: postgresql + componentDefRef: postgresql + serviceAccountName: kb-mycluster-pgcluster + monitor: false + replicas: 1 + volumeClaimTemplates: + - name: data + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 21Gi \ No newline at end of file diff --git a/test/e2e/testdata/smoketest/redis/09_backup_snapshot.yaml b/test/e2e/testdata/smoketest/redis/09_backup_snapshot.yaml deleted file mode 100644 index 138701dc3fe..00000000000 --- a/test/e2e/testdata/smoketest/redis/09_backup_snapshot.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: dataprotection.kubeblocks.io/v1alpha1 -kind: Backup -metadata: - labels: - app.kubernetes.io/instance: redis-cluster - dataprotection.kubeblocks.io/backup-type: snapshot - name: backup-snapshot-mycluster-redis -spec: - backupPolicyName: redis-cluster-redis-backup-policy - backupType: snapshot \ No newline at end of file diff --git a/test/e2e/testdata/smoketest/redis/09_backup_volume_snapshot.yaml b/test/e2e/testdata/smoketest/redis/09_backup_volume_snapshot.yaml new file mode 100644 index 00000000000..9d0766f9e62 --- /dev/null +++ b/test/e2e/testdata/smoketest/redis/09_backup_volume_snapshot.yaml @@ -0,0 +1,13 @@ +apiVersion: dataprotection.kubeblocks.io/v1alpha1 +kind: Backup +metadata: + name: backup-redis-cluster-snapshot +spec: + backupPolicyName: redis-cluster-redis-backup-policy + retentionPeriod: 7d + backupMethod: volume-snapshot + deletionPolicy: Delete +status: + duration: 60s + backupRepoName: my-repo + phase: Completed \ No newline at end of file diff --git a/test/e2e/testdata/smoketest/redis/10_backup_volume_snapshot_restore.yaml b/test/e2e/testdata/smoketest/redis/10_backup_volume_snapshot_restore.yaml new file mode 100644 index 00000000000..dbad9396d80 --- /dev/null +++ b/test/e2e/testdata/smoketest/redis/10_backup_volume_snapshot_restore.yaml @@ -0,0 +1,57 @@ +--- +# Source: redis-cluster/templates/cluster.yaml +apiVersion: apps.kubeblocks.io/v1alpha1 +kind: Cluster +metadata: + name: redis-cluster-snapshot + annotations: + kubeblocks.io/restore-from-backup: '{"redis":{"name":"backup-redis-cluster-snapshot","namespace":"default","managementPolicy":"Parallel"}}' +spec: + clusterDefinitionRef: redis # ref clusterDefinition.name + clusterVersionRef: redis-7.0.6 # ref clusterVersion.name + terminationPolicy: Delete + affinity: + topologyKeys: + - kubernetes.io/hostname + componentSpecs: + - name: redis # user-defined + componentDefRef: redis # ref clusterDefinition componentDefs.name + monitor: false + enabledLogs: ["running"] + replicas: 2 + serviceAccountName: kb-mycluster-redis-cluster + switchPolicy: + type: Noop + resources: + limits: + cpu: "500m" + memory: "3Gi" + requests: + cpu: "500m" + memory: "1Gi" + volumeClaimTemplates: + - name: data # ref clusterdefinition components.containers.volumeMounts.name + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 21Gi + - name: redis-sentinel # user-defined + componentDefRef: redis-sentinel # ref clusterDefinition componentDefs.name + replicas: 3 + resources: + limits: + cpu: "500m" + memory: "3Gi" + requests: + cpu: "500m" + memory: "1Gi" + volumeClaimTemplates: + - name: data # ref clusterdefinition components.containers.volumeMounts.name + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 21Gi diff --git a/test/e2e/testdata/smoketest/redis/11_backup_datafile.yaml b/test/e2e/testdata/smoketest/redis/11_backup_datafile.yaml new file mode 100644 index 00000000000..af9c1793b93 --- /dev/null +++ b/test/e2e/testdata/smoketest/redis/11_backup_datafile.yaml @@ -0,0 +1,13 @@ +apiVersion: dataprotection.kubeblocks.io/v1alpha1 +kind: Backup +metadata: + name: backup-redis-cluster +spec: + backupPolicyName: redis-cluster-redis-backup-policy + retentionPeriod: 7d + backupMethod: datafile + deletionPolicy: Delete +status: + duration: 60s + backupRepoName: my-repo + phase: Completed \ No newline at end of file diff --git a/test/e2e/testdata/smoketest/redis/10_backup_snapshot_restore.yaml b/test/e2e/testdata/smoketest/redis/12_backup_datafile_restore.yaml similarity index 90% rename from test/e2e/testdata/smoketest/redis/10_backup_snapshot_restore.yaml rename to test/e2e/testdata/smoketest/redis/12_backup_datafile_restore.yaml index 51ac069a11b..59c15a9794b 100644 --- a/test/e2e/testdata/smoketest/redis/10_backup_snapshot_restore.yaml +++ b/test/e2e/testdata/smoketest/redis/12_backup_datafile_restore.yaml @@ -3,9 +3,9 @@ apiVersion: apps.kubeblocks.io/v1alpha1 kind: Cluster metadata: - name: mycluster-redis-cluster-snapshot + name: redis-cluster-datafile annotations: - kubeblocks.io/restore-from-backup: "{\"redis\":\"backup-snapshot-mycluster-redis\"}" + kubeblocks.io/restore-from-backup: '{"redis":{"name":"backup-redis-cluster","namespace":"default","managementPolicy":"Parallel"}}' spec: clusterDefinitionRef: redis # ref clusterDefinition.name clusterVersionRef: redis-7.0.6 # ref clusterVersion.name diff --git a/test/e2e/testdata/smoketest/smoketestrun.go b/test/e2e/testdata/smoketest/smoketestrun.go index 30f09bb642b..5e4c55453fc 100644 --- a/test/e2e/testdata/smoketest/smoketestrun.go +++ b/test/e2e/testdata/smoketest/smoketestrun.go @@ -46,7 +46,7 @@ type Options struct { Dynamic dynamic.Interface } -var arr = []string{"00", "componentresourceconstraint", "restore", "class", "cv", "snapshot"} +var arr = []string{"00", "componentresourceconstraint", "restore", "class", "cv", "backup"} func SmokeTest() { BeforeEach(func() { diff --git a/test/e2e/testdata/smoketest/wesql/11_backup.yaml b/test/e2e/testdata/smoketest/wesql/11_backup_xtrabackup.yaml similarity index 91% rename from test/e2e/testdata/smoketest/wesql/11_backup.yaml rename to test/e2e/testdata/smoketest/wesql/11_backup_xtrabackup.yaml index 85db099a758..c898216bae6 100644 --- a/test/e2e/testdata/smoketest/wesql/11_backup.yaml +++ b/test/e2e/testdata/smoketest/wesql/11_backup_xtrabackup.yaml @@ -6,7 +6,7 @@ spec: backupPolicyName: mysql-cluster-mysql-backup-policy retentionPeriod: 7d backupMethod: xtrabackup - deletionPolicy: Retain + deletionPolicy: Delete status: duration: 60s backupRepoName: my-repo diff --git a/test/e2e/testdata/smoketest/wesql/12_backup_restore.yaml b/test/e2e/testdata/smoketest/wesql/12_backup_xtrabackup_restore.yaml similarity index 63% rename from test/e2e/testdata/smoketest/wesql/12_backup_restore.yaml rename to test/e2e/testdata/smoketest/wesql/12_backup_xtrabackup_restore.yaml index 6f0b7154b0b..6272e07304d 100644 --- a/test/e2e/testdata/smoketest/wesql/12_backup_restore.yaml +++ b/test/e2e/testdata/smoketest/wesql/12_backup_xtrabackup_restore.yaml @@ -1,23 +1,4 @@ --- -# Source: apecloud-mysql-cluster/templates/role.yaml -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: kb-mysql-cluster - namespace: default - labels: - app.kubernetes.io/name: apecloud-mysql-cluster - app.kubernetes.io/instance: mycluster - app.kubernetes.io/version: "8.0.30" - app.kubernetes.io/managed-by: Helm -rules: - - apiGroups: - - "" - resources: - - events - verbs: - - create ---- # Source: apecloud-mysql-cluster/templates/cluster.yaml apiVersion: apps.kubeblocks.io/v1alpha1 kind: Cluster diff --git a/test/e2e/testdata/smoketest/wesql/13_backup_volume_snapshot.yaml b/test/e2e/testdata/smoketest/wesql/13_backup_volume_snapshot.yaml new file mode 100644 index 00000000000..cfb46f70ae6 --- /dev/null +++ b/test/e2e/testdata/smoketest/wesql/13_backup_volume_snapshot.yaml @@ -0,0 +1,13 @@ +apiVersion: dataprotection.kubeblocks.io/v1alpha1 +kind: Backup +metadata: + name: backup-mysql-cluster-snapshot +spec: + backupPolicyName: mysql-cluster-mysql-backup-policy + retentionPeriod: 7d + backupMethod: volume-snapshot + deletionPolicy: Delete +status: + duration: 60s + backupRepoName: my-repo + phase: Completed \ No newline at end of file diff --git a/test/e2e/testdata/smoketest/wesql/14_backup_volume_snapshot_restore.yaml b/test/e2e/testdata/smoketest/wesql/14_backup_volume_snapshot_restore.yaml new file mode 100644 index 00000000000..ca28f38ef75 --- /dev/null +++ b/test/e2e/testdata/smoketest/wesql/14_backup_volume_snapshot_restore.yaml @@ -0,0 +1,26 @@ +--- +# Source: apecloud-mysql-cluster/templates/cluster.yaml +apiVersion: apps.kubeblocks.io/v1alpha1 +kind: Cluster +metadata: + name: mysql-cluster-restore + annotations: + kubeblocks.io/restore-from-backup: '{"mysql":{"name":"backup-mysql-cluster-snapshot","namespace":"default","managementPolicy":"Parallel"}}' +spec: + clusterDefinitionRef: apecloud-mysql + clusterVersionRef: ac-mysql-8.0.30 + terminationPolicy: WipeOut + componentSpecs: + - name: mysql + componentDefRef: mysql + monitor: false + replicas: 1 + serviceAccountName: kb-mysql-cluster + volumeClaimTemplates: + - name: data + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 20Gi