backube / volsync

Asynchronous data replication for Kubernetes volumes
https://volsync.readthedocs.io
GNU Affero General Public License v3.0
587 stars 68 forks source link

Syncthing Replication with Multiple Sources to Centralized Target #729

Open simplerick0 opened 1 year ago

simplerick0 commented 1 year ago

Describe the feature you'd like to have. I am looking to use Syncthing as a replication type to copy multiple PVCs into separate folders on a single machine.

What is the value to the end user? (why is it a priority?) I would see this as a partial/rudimentary backup solution.

How will we know we have a good solution? (acceptance criteria) Be able to have two ReplicationSources that share a peer, but sync to separate folders on that peer. For example:

Additional context It appears that the syncthing folder id is static and cannot be changed. When a single central location is used for multiple ReplicationSources, they each try to share the folder with the same ID and data is clobbered.

I attempted to modify the config.xml in place on the volsync config PVCs, but that does not appear to be used when the device tries to share the folder the first time. If I update the id in the config, delete the device and let it reconnect, the folder-id is still the original default.

Is there any config that I may be missing to accomplish this, or am I missing something that would prevent it?

simplerick0 commented 1 year ago

Turns out modifying the folder-id in config.xml does work, I just needed to restart the volsync pod for the change to be picked up. I think all that would be needed to make this work more smoothly would be to add another variable like the ones used here: https://github.com/backube/volsync/blob/main/mover-syncthing/entry.sh#L70