vmware-tanzu / velero

Backup and migrate Kubernetes applications and their persistent volumes
https://velero.io
Apache License 2.0
8.77k stars 1.41k forks source link

Local Path Provisioner and Velero #8251

Closed mt190502 closed 1 month ago

mt190502 commented 1 month ago

Hello.

I am using local-path-provisioner in my Kubernetes environment. I created a local minio server for backups. I installed and configured Velero, but when I take a backup, I get the following warning.

time="2024-09-23T10:28:03Z" level=info msg="Summary for skipped PVs: [{\"name\":\"pvc-29b814db-3cde-4633-8890-dc279bb47e05\",\"reasons\":[{\"approach\":\"podvolume\",\"reason\":\"opted out due to annotation in pod commafeed-k8s-web-7b8bfb6876-5d9rm\"},{\"approach\":\"volumeSnapshot\",\"reason\":\"no applicable volumesnapshotter found\"}]},{\"name\":\"pvc-d1f4e278-f990-4d43-b330-1710596a0804\",\"reasons\":[{\"approach\":\"podvolume\",\"reason\":\"opted out due to annotation in pod commafeed-k8s-postgres-6c44f9c98b-j6frs\"},{\"approach\":\"volumeSnapshot\",\"reason\":\"no applicable volumesnapshotter found\"}]}]" backup=velero/commafeed-k8s logSource="pkg/backup/backup.go:495"

I configured velero this params:

 velero install --provider aws \
      --plugins velero/velero-plugin-for-aws:v1.10.1 \
      --bucket velero-backup \
      --secret-file ./credentials-velero \
      --use-volume-snapshots=false --backup-location-config region=minio,s3ForcePathStyle="true",s3Url=http://$(tailscale ip --4 m1):30010 --use-node-agent

I followed this issue and i convert all pvs type local from hostpath: https://github.com/rancher/local-path-provisioner/issues/85 Is there any way to use velero with local-path-provisioner? Thanks.

reasonerjt commented 1 month ago

I assume snapshot won't work for local provisioner, please use the flag --default-volumes-to-fs-backup to use fs-backup for the data in your volume.

mt190502 commented 1 month ago

Yeah. That's worked. Thanks for helps. I reinstalled velero with this parameters:

❯ velero install --provider aws \
      --plugins velero/velero-plugin-for-aws:v1.10.1 \
      --bucket velero-backup \
      --secret-file ./credentials-velero \
      --use-volume-snapshots=false --backup-location-config region=minio,s3ForcePathStyle="true",s3Url=http://$(tailscale ip --4 m1):30010 --use-node-agent --default-volumes-to-fs-backup

image

image

mt190502 commented 1 month ago

I tried delete a deployment for backup/restore test. But i get this error

image

image

Edit: Postgresql official docker image changes default permissions to 999:999. I changed the folder permissions with this command and the restore was completed:

chmod 777 /opt/local-path-provisioner/pvc.......