diff --git a/drivers/scheduler/k8s/specs/postgres-backup-multivol/px-postgres-app.yaml b/drivers/scheduler/k8s/specs/postgres-backup-multivol/px-postgres-app.yaml index b12e09411..237c7a9d2 100644 --- a/drivers/scheduler/k8s/specs/postgres-backup-multivol/px-postgres-app.yaml +++ b/drivers/scheduler/k8s/specs/postgres-backup-multivol/px-postgres-app.yaml @@ -28,6 +28,28 @@ spec: values: - postgres topologyKey: "kubernetes.io/hostname" + initContainers: + - name: init-postgres-data + image: busybox + command: ["/bin/sh", "-c"] + args: + {{ if .ClaimsCount }} + {{- range $val := Iterate .ClaimsCount }} + - echo "Initializing data for postgredb-{{ $val }}"; dd if=/dev/zero of=/mnt/data{{ $val }}/initfile bs=1M count=10; + {{- end }} + {{ else }} + - echo "Initializing data for postgredb"; dd if=/dev/zero of=/mnt/data/initfile bs=1M count=10; + {{- end }} + volumeMounts: + {{ if .ClaimsCount }} + {{- range $val := Iterate .ClaimsCount }} + - name: postgredb-{{ $val }} + mountPath: /mnt/data{{ $val }} + {{- end }} + {{ else }} + - name: postgredb + mountPath: /mnt/data + {{- end }} containers: - name: postgres image: postgres:9.5 @@ -45,14 +67,14 @@ spec: value: /var/lib/postgresql/data/pgdata volumeMounts: {{ if .ClaimsCount }} - {{- range $val := Iterate .ClaimsCount }} - - name: postgredb-{{ $val }} - mountPath: /var/lib/postgresql/data{{ $val }} - {{- end }} - {{ else }} - - name: postgredb - mountPath: /var/lib/postgresql/data - {{- end }} + {{- range $val := Iterate .ClaimsCount }} + - name: postgredb-{{ $val }} + mountPath: /var/lib/postgresql/data{{ $val }} + {{- end }} + {{ else }} + - name: postgredb + mountPath: /var/lib/postgresql/data + {{- end }} readinessProbe: exec: command: ["psql", "-U", "pgbench", "-c", "CREATE TABLE IF NOT EXISTS test_table ( test_text TEXT ); INSERT INTO test_table VALUES ( 'test_message' ); SELECT * FROM test_table; SELECT pg_sleep(1); DELETE FROM test_table;"] @@ -64,14 +86,14 @@ spec: initialDelaySeconds: 45 timeoutSeconds: 2 volumes: - {{ if .ClaimsCount }} - {{- range $val := Iterate .ClaimsCount }} - - name: postgredb-{{ $val }} - persistentVolumeClaim: - claimName: postgres-data-{{ $val }} - {{- end }} - {{- else }} - - name: postgredb - persistentVolumeClaim: - claimName: postgres-data - {{- end }} \ No newline at end of file + {{ if .ClaimsCount }} + {{- range $val := Iterate .ClaimsCount }} + - name: postgredb-{{ $val }} + persistentVolumeClaim: + claimName: postgres-data-{{ $val }} + {{- end }} + {{- else }} + - name: postgredb + persistentVolumeClaim: + claimName: postgres-data + {{- end }} diff --git a/tests/backup/backup_test_labels.go b/tests/backup/backup_test_labels.go index b383f56f0..c80756f61 100644 --- a/tests/backup/backup_test_labels.go +++ b/tests/backup/backup_test_labels.go @@ -381,6 +381,11 @@ const ( SkipTestLabel = "skip-test" ) +// Scale test labels +const ( + ScaleTestLabel = "Scale-test" +) + // Volume labels const ( PortworxVolumeLabel = "portworx-volume" @@ -410,7 +415,7 @@ var TestCaseLabelsMap = map[TestCaseName][]TestCaseLabel{ DuplicateSharedBackup: {DuplicateSharedBackupLabel, aetosl3awsVanilla, aetosl3awsrke, aetosl3awsPXBackupupgrade, aetosl3awsstorkupgrade, aetosl3awsPXBackupStorkupgrade, aetosl3nfsrke, aetosl3nfsVanilla, vanillaFacdPipelineS3, vanillaFacdPipelineNfs, vanillaFadaPipelineS3, vanillaFadaPipelineNfs, vanillaFBDAPipelineS3, vanillaFBDAPipelineNfs, ibmNonPXIKSPipelineS3, ibmPxIKSPipelineS3, ibmNonPxRoksPipelineS3, ibmPxRoksPipelineS3, ibmNonPxIksPipelineS3Upgrade, ibmPxIksPipelineS3Upgrade, ocpPxPipelineS3Upgrade, ibmNonPxRoksPipelineS3Upgrade, vanillaPipelineS3Upgrade, VanillaPipelineS3StorkUpgrade, vanillaPipelineS3Nightly, vanillaPipelineNfsNightly}, DifferentAccessSameUser: {DifferentAccessSameUserLabel, aetosl3awsVanilla, aetosl3awsrke, aetosl3awsPXBackupupgrade, aetosl3awsstorkupgrade, aetosl3awsPXBackupStorkupgrade, aetosl3nfsrke, aetosl3nfsVanilla, vanillaFacdPipelineS3, vanillaFacdPipelineNfs, vanillaFadaPipelineS3, vanillaFadaPipelineNfs, vanillaFBDAPipelineS3, vanillaFBDAPipelineNfs, ibmNonPXIKSPipelineS3, ibmPxIKSPipelineS3, ibmNonPxRoksPipelineS3, ibmPxRoksPipelineS3, ibmNonPxIksPipelineS3Upgrade, ibmPxIksPipelineS3Upgrade, ocpPxPipelineS3Upgrade, ibmNonPxRoksPipelineS3Upgrade, vanillaPipelineS3Upgrade, VanillaPipelineS3StorkUpgrade, vanillaPipelineS3Nightly, vanillaPipelineNfsNightly}, ShareBackupWithUsersAndGroups: {ShareBackupWithUsersAndGroupsLabel, aetosl3awsVanilla, aetosl3awsrke, aetosl3awsPXBackupupgrade, aetosl3awsstorkupgrade, aetosl3awsPXBackupStorkupgrade, aetosl3nfsrke, aetosl3nfsVanilla, vanillaFacdPipelineS3, vanillaFacdPipelineNfs, vanillaFadaPipelineS3, vanillaFadaPipelineNfs, vanillaFBDAPipelineS3, vanillaFBDAPipelineNfs, ibmNonPXIKSPipelineS3, ibmPxIKSPipelineS3, ibmNonPxRoksPipelineS3, ibmPxRoksPipelineS3, ibmNonPxIksPipelineS3Upgrade, ibmPxIksPipelineS3Upgrade, ocpPxPipelineS3Upgrade, ibmNonPxRoksPipelineS3Upgrade, vanillaPipelineS3Upgrade, VanillaPipelineS3StorkUpgrade, vanillaPipelineS3Nightly}, - ShareLargeNumberOfBackupsWithLargeNumberOfUsers: {ShareLargeNumberOfBackupsWithLargeNumberOfUsersLabel}, + ShareLargeNumberOfBackupsWithLargeNumberOfUsers: {ShareLargeNumberOfBackupsWithLargeNumberOfUsersLabel, ScaleTestLabel}, CancelClusterBackupShare: {CancelClusterBackupShareLabel, aetosl3awsVanilla, aetosl3awsrke, aetosl3awsPXBackupupgrade, aetosl3awsstorkupgrade, aetosl3awsPXBackupStorkupgrade, aetosl3nfsrke, aetosl3nfsVanilla, vanillaFacdPipelineS3, vanillaFacdPipelineNfs, vanillaFadaPipelineS3, vanillaFadaPipelineNfs, vanillaFBDAPipelineS3, vanillaFBDAPipelineNfs, ibmNonPXIKSPipelineS3, ibmPxIKSPipelineS3, ibmNonPxRoksPipelineS3, ibmPxRoksPipelineS3, ocpPxPipelineS3Upgrade, vanillaPipelineS3Upgrade, VanillaPipelineS3StorkUpgrade, vanillaPipelineS3Nightly, vanillaPipelineNfsNightly}, ShareBackupAndEdit: {ShareBackupAndEditLabel, aetosl3awsVanilla, aetosl3awsrke, aetosl3awsPXBackupupgrade, aetosl3awsstorkupgrade, aetosl3awsPXBackupStorkupgrade, aetosl3nfsrke, aetosl3nfsVanilla, vanillaFacdPipelineS3, vanillaFacdPipelineNfs, vanillaFadaPipelineS3, vanillaFadaPipelineNfs, vanillaFBDAPipelineS3, vanillaFBDAPipelineNfs, ibmNonPXIKSPipelineS3, ibmPxIKSPipelineS3, ibmNonPxRoksPipelineS3, ibmPxRoksPipelineS3, ibmNonPxIksPipelineS3Upgrade, ibmPxIksPipelineS3Upgrade, ocpPxPipelineS3Upgrade, ibmNonPxRoksPipelineS3Upgrade, vanillaPipelineS3Upgrade, VanillaPipelineS3StorkUpgrade, vanillaPipelineS3Nightly}, SharedBackupDelete: {SharedBackupDeleteLabel, aetosl3awsVanilla, aetosl3awsrke, aetosl3awsPXBackupupgrade, aetosl3awsstorkupgrade, aetosl3awsPXBackupStorkupgrade, aetosl3nfsrke, aetosl3nfsVanilla, vanillaFacdPipelineS3, vanillaFacdPipelineNfs, vanillaFadaPipelineS3, vanillaFadaPipelineNfs, vanillaFBDAPipelineS3, vanillaFBDAPipelineNfs, ibmNonPXIKSPipelineS3, ibmPxIKSPipelineS3, ibmNonPxRoksPipelineS3, ibmPxRoksPipelineS3, ibmNonPxIksPipelineS3Upgrade, ibmPxIksPipelineS3Upgrade, ocpPxPipelineS3Upgrade, ibmNonPxRoksPipelineS3Upgrade, vanillaPipelineS3Upgrade, VanillaPipelineS3StorkUpgrade, vanillaPipelineS3Nightly, vanillaPipelineNfsNightly}, @@ -484,7 +489,7 @@ var TestCaseLabelsMap = map[TestCaseName][]TestCaseLabel{ BackupNamespaceInNfsRestoredFromS3: {BackupNamespaceInNfsRestoredFromS3Label, aetosl3awsVanilla, aetosl3awsrke, aetosl3nfsrke, aetosl3nfsVanilla, vanillaPipelineS3Upgrade, VanillaPipelineS3StorkUpgrade, vanillaPipelineS3Nightly, vanillaPipelineNfsNightly}, DeleteS3ScheduleAndCreateNfsSchedule: {DeleteS3ScheduleAndCreateNfsScheduleLabel, aetosl3awsVanilla, aetosl3awsrke, aetosl3nfsrke, aetosl3nfsVanilla, vanillaPipelineS3Upgrade, VanillaPipelineS3StorkUpgrade, vanillaPipelineS3Nightly, vanillaPipelineNfsNightly}, KubeAndPxNamespacesSkipOnAllNSBackup: {KubeAndPxNamespacesSkipOnAllNSBackupLabel, aetosl3awsVanilla, aetosl3nfsVanilla, vanillaFacdPipelineS3, vanillaFacdPipelineNfs, vanillaFadaPipelineS3, vanillaFadaPipelineNfs, vanillaFBDAPipelineS3, vanillaFBDAPipelineNfs, vanillaPipelineS3Upgrade, VanillaPipelineS3StorkUpgrade, vanillaPipelineS3Nightly, vanillaPipelineNfsNightly}, - MultipleBackupLocationWithSameEndpoint: {MultipleBackupLocationWithSameEndpointLabel}, + MultipleBackupLocationWithSameEndpoint: {MultipleBackupLocationWithSameEndpointLabel, ScaleTestLabel}, UpgradePxBackup: {UpgradePxBackupLabel}, StorkUpgradeWithBackup: {StorkUpgradeWithBackupLabel}, PXBackupEndToEndBackupAndRestoreWithUpgrade: {PXBackupEndToEndBackupAndRestoreWithUpgradeLabel}, @@ -510,13 +515,13 @@ var TestCaseLabelsMap = map[TestCaseName][]TestCaseLabel{ DefaultBackupRestoreWithKubevirtAndNonKubevirtNS: {DefaultBackupRestoreWithKubevirtAndNonKubevirtNSLabel, KubevirtAppLabel}, KubevirtScheduledVMDelete: {KubevirtScheduledVMDeleteLabel, KubevirtAppLabel}, CustomBackupRestoreWithKubevirtAndNonKubevirtNS: {CustomBackupRestoreWithKubevirtAndNonKubevirtNSLabel, KubevirtAppLabel}, - ExcludeInvalidDirectoryFileBackup: {ExcludeInvalidDirectoryFileBackupLabel}, - ExcludeDirectoryFileBackup: {ExcludeDirectoryFileBackupLabel}, + ExcludeInvalidDirectoryFileBackup: {ExcludeInvalidDirectoryFileBackupLabel, ScaleTestLabel}, + ExcludeDirectoryFileBackup: {ExcludeDirectoryFileBackupLabel, ScaleTestLabel}, MultipleMemberProjectBackupAndRestoreForSingleNamespace: {MultipleMemberProjectBackupAndRestoreForSingleNamespaceLabel}, MultipleProvisionerCsiSnapshotDeleteBackupAndRestore: {MultipleProvisionerCsiSnapshotDeleteBackupAndRestoreLabel}, BackupNetworkErrorTest: {BackupNetworkErrorTestLabel}, IssueMultipleBackupsAndRestoreInterleavedCopies: {IssueMultipleBackupsAndRestoreInterleavedCopiesLabel}, - ValidateFiftyVolumeBackups: {ValidateFiftyVolumeBackupsLabel}, + ValidateFiftyVolumeBackups: {ValidateFiftyVolumeBackupsLabel, ScaleTestLabel}, PXBackupClusterUpgradeTest: {PXBackupClusterUpgradeTestLabel}, BackupToLockedBucketWithSharedObjects: {BackupToLockedBucketWithSharedObjectsLabel, vanillaPipelineWithS3LockedBucket}, RemoveJSONFilesFromNFSBackupLocation: {RemoveJSONFilesFromNFSBackupLocationLabel},