[QUESTION]: Is there a way to safely move data disks from one Kubernetes cluster to another?
grig777 opened this issue · 3 comments
I'm looking for guidance on transferring data disks between Kubernetes clusters using the MinIO DirectPV CSI tool. I want to ensure that the migration process does not result in any data loss. Additionally, I'm interested in understanding if the tool provides any mechanisms or best practices for recovering a MinIO cluster in situations where the Kubernetes cluster is lost or unavailable, but the disks with the MinIO cluster's data are still accessible.
If you are able to backup/restore kubernetes from one cluster to another cluster, then below information is helpful
- The best way to move data DirectPV from one cluster to another cluster is, move the physical drives i.e. remove from source cluster and add then into destination cluster.
- If the above is not possible, use any disk copying utility (like
dd
) to copy individual source disks to destination disks. - Remember that source and destination clusters should have a same hostnames.
Regarding MinIO
server, please open the question in respective project.
I am currently working with two Kubernetes clusters, and I have installed the MinIO DirectPV CSI driver on both clusters. In my initial cluster (source cluster), I have utilized the kubectl directpv discover
command followed by kubectl directpv init drivers.yaml --dangerous
to initialize the DirectPV volumes and store data on them through a stateful application.
Now, I need to move the physical data disks from the source cluster to the destination cluster without any data loss. I have successfully reattached the disks to the nodes in the destination cluster and confirmed their presence using the lsblk
command.
However, I am unsure about the next steps to take. If I use thekubectl directpv discover && kubectl directpv init drivers.yaml --dangerous
command in the destination cluster, it will erase the disks, resulting in data loss. Therefore, I would like to know how I can correctly mount the disks in the destination cluster and register them properly to preserve the data integrity.
Take a backup of directpvdrives
and directpvvolumes
CRDs from your source cluster and apply to destination cluster. Then restart all DirectPV pods by kubectl -n directpv delete pods --all
.
Note: if node names are different in source and destination cluster, fix it in those CRDs manually before applying.