Getting error while AWS EKS cluster backup using Velero tool

12/14/2020

Please let me know what is my mistake!

Used this command to backup AWS EKS cluster using velero tool but it's not working :

./velero.exe install --provider aws --bucket backup-archive/eks-cluster-backup/prod-eks-cluster/ --secret-file ./minio.credentials --use-restic --backup-location-config region=minio,s3ForcePathStyle=true,s3Url=s3Url=s3://backup-archive/eks-cluster-backup/prod-eks-cluster/ --kubeconfig ../kubeconfig-prod-eks --plugins velero/velero-plugin-for-aws:v1.0.0

cat minio.credentials

[default]
aws_access_key_id=xxxx
aws_secret_access_key=yyyyy/zzzzzzzz
region=ap-southeast-1

Getting Error:

../kubectl.exe --kubeconfig=../kubeconfig-prod-eks.txt logs deployment/velero -n velero
time="2020-12-09T09:07:12Z" level=error msg="Error getting backup store for this location" backupLocation=default controller=backup-sync error="backup storage location's bucket name \"backup-archive/eks-cluster-backup/\" must not contain a '/' (if using a prefix, put it in the 'Prefix' field instead)" error.file="/go/src/github.com/vmware-tanzu/velero/pkg/persistence/object_store.go:110" error.function=github.com/vmware-tanzu/velero/pkg/persistence.NewObjectBackupStore logSource="pkg/controller/backup_sync_controller.go:168"

Note: I have tried --bucket backup-archive but still no use

-- Ashish Karpe
amazon-eks
amazon-s3
kubernetes
velero

1 Answer

12/19/2020

This is the source of your problem: --bucket backup-archive/eks-cluster-backup/prod-eks-cluster/.

The error says: must not contain a '/'.

This means it cannot contain a slash in the middle of the bucket name (leading/trailing slashes are trimmed, so that's not a problem). Source: https://github.com/vmware-tanzu/velero/blob/3867d1f434c0b1dd786eb8f9349819b4cc873048/pkg/persistence/object_store.go#L102-L111.

If you want to namespace your backups within a bucket, you may use the --prefix parameter. Like so:

--bucket backup-archive --prefix /eks-cluster-backup/prod-eks-cluster/.

-- carlisia
Source: StackOverflow