'Replicate / synchronise kubernetes PV data across seperate kubernetes clusters
Can I replicate data between Kubernetes PV into two separate clusters situated in different data centers?
I have a cluster with associated PV running in Primary site. I have a separate cluster running in DR site.
How do I continuously replicate data in primary site to DR site so that when application is running from from DR? The data written to PR PVs are available in DR.
Application writes files to the PV like xls, csv etc.
I can use any OSS storage orchestrator like openebs, rook, storageos etc.
Database is outside of kubernetes.
Solution 1:[1]
Forget Kubernetes for some time. End of the day, you are talking sync files between two storages. Mounting it into Kubernetes as PV is just your choice. So it can be as simple as a rsync setup between two storages?
Solution 2:[2]
Narain is right. Kubernetes doesn't contain any functionality that would allow you to synchronize two PVs used by two different clusters. So you would need to find your own solution to synchronize those two filesystems. It can be an existing solution like lsyncd, proposed in this thread or any custom solution like the above mentioned rsync which can be wrapped into a simple bash script and run periodically in cron.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Narain |
| Solution 2 | mario |
