diff --git a/Filer-Active-Active-cross-cluster-continuous-synchronization.md b/Filer-Active-Active-cross-cluster-continuous-synchronization.md index 33b6ac7..9fa7f7f 100644 --- a/Filer-Active-Active-cross-cluster-continuous-synchronization.md +++ b/Filer-Active-Active-cross-cluster-continuous-synchronization.md @@ -22,6 +22,38 @@ weed filer.sync -a : -b : -i At the beginning, it will bootstrap from the beginning of time, or resume from the last replication checkpoint. Later, it will just run continuously and persist checkpoints periodically. +## On Kubernetes with the SeaweedFS Operator + +If you are running SeaweedFS on Kubernetes via the [SeaweedFS Operator](https://github.com/seaweedfs/seaweedfs-operator), you can run `weed filer.sync` as a sidecar inside the filer pod itself, so it shares the pod's lifecycle and dials the local filer over loopback. Each `ComponentSpec` exposes a `sidecars` field that accepts arbitrary `v1.Container` entries. + +```yaml +apiVersion: seaweed.seaweedfs.com/v1 +kind: Seaweed +metadata: + name: prod +spec: + image: chrislusf/seaweedfs:latest + master: + replicas: 3 + volume: + replicas: 3 + requests: + storage: 100Gi + filer: + replicas: 2 + sidecars: + - name: filer-sync + image: chrislusf/seaweedfs:latest + command: + - weed + - filer.sync + - -a=localhost:8888 + - -b=remote-filer.dr.svc.cluster.local:8888 + - -isActivePassive +``` + +The sidecar runs alongside every filer replica. For active-passive replication you typically want a single sync process — pin the sidecar to one replica with a separate single-replica filer, or run `filer.sync` as its own `Deployment` instead. + ## How it works? Each filer has its own local change logs. `weed filer.sync` will read the logs and replay them in the other cluster.