Thanks to visit codestin.com
Credit goes to github.com

Skip to content

perfectra1n/volsync

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VolSync

Fork Notes

Note: This is a fork of backube/volsync.

If you need help or have any questions, join the home-operations Discord!

For installation of the Helm Chart from this fork, use:

helm repo add volsync-fork https://perfectra1n.github.io/volsync/charts
helm install --create-namespace -n volsync-system volsync volsync-fork/volsync

Specify the mover image(s), for at least Kopia, here in the Helm chart values, and specify the image to be:

ghcr.io/perfectra1n/volsync:latest

Also, the documentation is hosted in the GitHub Pages documentation (Fork documentation mirror)

As an example, this is my Argo Helm Chart release (and please check for the latest version here):

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: volsync
  namespace: argocd

spec:
  project: default
  source:
    chart: volsync
    repoURL: https://perfectra1n.github.io/volsync/charts/
    targetRevision: "0.15.4"
    helm:
      values: |
        manageCRDs: true
        metrics:
          disableAuth: true
        image:
          repository: ghcr.io/perfectra1n/volsync
          tag: "0.15.21"
          image: ""
        kopia:
          repository: ghcr.io/perfectra1n/volsync
          tag: "0.15.21"
          image: ""
        rclone:
          repository: ghcr.io/perfectra1n/volsync
          # Overrides the image tag whose default is the chart appVersion.
          tag: "0.15.1"
          image: ""
        restic:
          repository: ghcr.io/perfectra1n/volsync
          # Overrides the image tag whose default is the chart appVersion.
          tag: "0.15.1"
          image: ""
        rsync:
          repository: ghcr.io/perfectra1n/volsync
          # Overrides the image tag whose default is the chart appVersion.
          tag: "0.15.1"
          image: ""
        rsync-tls:
          repository: ghcr.io/perfectra1n/volsync
          # Overrides the image tag whose default is the chart appVersion.
          tag: "0.15.1"
          image: ""
        syncthing:
          repository: ghcr.io/perfectra1n/volsync
          # Overrides the image tag whose default is the chart appVersion.
          tag: "0.15.1"
          image: ""

Then a ReplicationSource example:

apiVersion: volsync.backube/v1alpha1
kind: ReplicationSource
metadata:
  name: homepage-kopia
  namespace: apps
spec:
  sourcePVC: homepage-icons
  trigger:
    schedule: "0 */4 * * *"
  kopia:
    copyMethod: Direct
    repository: volsync-kopia-repo
    # Note: hostname is ALWAYS just the namespace "apps" (intentional design)
    # All ReplicationSources in namespace share same hostname (multi-tenancy design)
    # Combined with unique username, creates unique identity: homepage-kopia@apps
    username: homepage-kopia  # Custom username
    retain:
      weekly: 2
      monthly: 4
    moverSecurityContext:
      runAsUser: 0
      runAsGroup: 0
      fsGroup: 0

a ReplicationDestination example:

Simple same-namespace restore (NO identity configuration needed):

# Use case: Restore in same namespace with matching destination name
# NO sourceIdentity needed - fully automatic!
apiVersion: volsync.backube/v1alpha1
kind: ReplicationDestination
metadata:
  name: homepage-kopia  # Same name as ReplicationSource
  namespace: apps      # Same namespace as source
spec:
  trigger:
    manual: restore-now
  kopia:
    # NO IDENTITY CONFIGURATION NEEDED!
    # When destination name matches source name in same namespace:
    # - Automatically discovers: username = homepage-kopia
    # - Automatically uses: hostname = apps (always just namespace)
    destinationPVC: restored-data
    copyMethod: Direct
    storageClassName: "truenas-csi-iscsi"

Cross-namespace restore (sourceIdentity REQUIRED):

# Use case: Restore across namespaces or with different destination name
# sourceIdentity REQUIRED for cross-namespace restores
apiVersion: volsync.backube/v1alpha1
kind: ReplicationDestination
metadata:
  name: kopia-test-restore  # Different name than source
  namespace: test           # Different namespace than source
spec:
  trigger:
    manual: restore-test
  kopia:
    #   sourceIdentity REQUIRED because:
    #   - Source is in different namespace (apps ≠ test)
    #   - Destination name differs from source name
    sourceIdentity:
      sourceName: homepage-kopia
      sourceNamespace: apps  # Source namespace (hostname will be "apps")
      # PVC name auto-discovered from source ReplicationSource
    destinationPVC: test-restore-data
    copyMethod: Direct
    storageClassName: "truenas-csi-iscsi"
    previous: 1
    moverSecurityContext:
      runAsUser: 0
      runAsGroup: 0
      fsGroup: 0

When sourceIdentity is needed:

  • Cross-namespace restores (source and destination in different namespaces)
  • Different destination name (destination name ≠ source ReplicationSource name)
  • Source used custom identity (custom username/hostname in ReplicationSource)

When sourceIdentity is NOT needed:

  • Same namespace + same name (destination name = source name, same namespace)
  • Default source identity (source used no custom username/hostname)

And a repository example:

apiVersion: v1
kind: Secret
metadata:
  name: volsync-kopia-repo
  namespace: storage
  annotations:
    replicator.v1.mittwald.de/replicate-to: "asdf,asdf,asdf"
type: Opaque
stringData:
  # The repository url
  KOPIA_REPOSITORY: s3://kopia-volsync-backups/backups
  # The repository encryption key
  KOPIA_PASSWORD: "kopiapassword"
  AWS_ACCESS_KEY_ID: "kopia-volsync-user"
  AWS_SECRET_ACCESS_KEY: "minio-user-password"
  # For non-AWS S3 (MinIO, etc.)
  AWS_S3_ENDPOINT: s3.example.com
  KOPIA_S3_ENDPOINT: s3.example.com
  # Optional: specify region
  AWS_REGION: us-east-1

Again, the documentation is hosted in the GitHub Pages documentation (Fork documentation mirror)

Overview

VolSync asynchronously replicates Kubernetes persistent volumes between clusters using either rsync or rclone. It also supports creating backups of persistent volumes via restic.

Documentation Status Go Report Card codecov maturity

Documentation operator

Getting started

The fastest way to get started is to install VolSync in a kind cluster:

  • Install kind if you don't already have it:
    $ go install sigs.k8s.io/kind@latest
  • Use our convenient script to start a cluster, install the CSI hostpath driver, and the snapshot controller.
    $ ./hack/setup-kind-cluster.sh
  • Install the latest release via Helm
    $ helm repo add backube https://backube.github.io/helm-charts/
    $ helm install --create-namespace -n volsync-system volsync backube/volsync
  • See the usage instructions for information on setting up replication relationships.

More detailed information on installation and usage can be found in the official documentation.

Helpful links

Licensing

This project is licensed under the GNU AGPL 3.0 License with the following exceptions:

About

Asynchronous data replication for Kubernetes volumes

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • Go 91.6%
  • Shell 5.1%
  • Roff 2.5%
  • Makefile 0.4%
  • Dockerfile 0.2%
  • Jinja 0.1%
  • Other 0.1%