vmware-tanzu / velero

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

Add support for FSB to WebDAV storage via kopia #7495

Open Talinx opened 5 months ago

Talinx commented 5 months ago

Describe the problem/challenge you have

We have the requirement to run everything and to store everything on european cloud providers. We use Hetzner to host our K8s cluster. Hetzner's CSI driver does not support volume snapshots so we want to use FSB to back up volumes.

Velero currently only supports AWS, Azure and GCP for FSB backups via kopia. These are not european cloud providers. For restic the situation is similar.

Describe the solution you'd like

Support for different cloud providers could be added via kopia. Kopia supports more protocols than velero exposes. Support for a different protocol from kopia like WebDAV or SFTP could be added to support arbitrary cloud providers.

Anything else you would like to add:

We need a backup solution and other solutions for K8s do not fit our requirements without modification so we already implemented this:

Environment:

Vote on this issue!

This is an invitation to the Velero community to vote on issues, you can see the project's top voted issues listed here.
Use the "reaction smiley face" up to the right of this comment to vote.

weshayutin commented 5 months ago

@Talinx best if this is created in https://issues.redhat.com/issues/?filter=12413995 for project = "OADP"

sseago commented 5 months ago

"Velero currently only supports AWS, Azure and GCP for FSB backups via kopia. These are not european cloud providers. For restic the situation is similar." -- note that the AWS provider for object storage uses s3, so any s3-compliant provider should be supported, or are you asking for support for additional object storage providers that do not support S3?

Talinx commented 5 months ago

I didn't know that any S3-compliant provider works, that's good to know! Unfortunately the cloud provider we are using does not support S3.

sseago commented 5 months ago

Also, keep in mind that Kopia is only used for PVC data backup -- it uses the same object store plugin to store kopia data in the BackupStorageLocation that velero uses for storing the backup itself. Supporting additional object stores would need to be done by writing an ObjectStore plugin, since we'll still need to store backup metadata outside of the kopia/PVC context.

Talinx commented 5 months ago

Yes, wrote a plugin already: https://github.com/Talinx/velero-plugin-for-webdav/

Lyndon-Li commented 5 months ago

@Talinx Could you share which cloud provider are you using?

Talinx commented 5 months ago

Hetzner with Storage Box as WebDAV server.

The cluster is setup with this: https://github.com/kube-hetzner/terraform-hcloud-kube-hetzner

(This setup uses SELinux and requires a SELinux policy for FSB backups to work. For this a file called fsb_files_policy.te with the following contents is created on every worker node:)

module fsb_files_policy 1.0;

require {
  type container_file_t;
  type container_t;
  class lnk_file read;
}

#============= container_t ==============
allow container_t container_file_t:lnk_file read;

And applied:

checkmodule -m -o fsb_files_policy.mod fsb_files_policy.te
semodule_package -o fsb_files_policy.pp -m fsb_files_policy.mod
semodule -i fsb_files_policy.pp
reasonerjt commented 5 months ago

@weshayutin I'm assigning this to you to triage if this requires changes in upstream.