VolSync is a Kubernetes operator that asynchronously replicates persistent volumes between clusters using rsync or rclone. It also supports creating backups of persistent volumes via restic.
Installation:
Install VolSync via Helm:
|
|
Migrating Data into Kubernetes:
VolSync provides a CLI tool (kubectl-volsync) for migrating data from external storage into Kubernetes PersistentVolumes.
Step 1: Install VolSync CLI
Install the CLI using Krew:
|
|
Step 2: Create Migration Destination
Create a namespace and migration destination:
|
|
This creates a 2Gi PVC named mydata in the destination namespace.
Step 3: Copy Data into PVC
Migrate data from external storage (e.g., local directory):
|
|
This synchronizes /tmp/data/ into the mydata PVC.
Step 4: Use Migrated Data
Deploy a pod to access the migrated data:
|
|
Step 5: Clean Up
Remove migration resources after completion:
|
|
For detailed documentation and advanced usage, see the VolSync documentation and GitHub repository.