Restore from a snapshot in a different kubernetes namespace


#1

Hi guys,

How can I restore from a snapshot that was taken in a different namespace?

By using kubedb, I deployed an instance of mongodb into namespace A, and took a snapshot of that instance. Now I want to deploy another instance of mongodb in a different namespace, and initiating it with the snapshot that was taken earlier.

How can I achieve that?

Thanks :slight_smile:


#2

Hi Haim_Kabesa,
You can specify namespace in init.snapshotSource field of MongoDB crd.

Check the yaml from here:


#3

Hi @emruz,

Thanks for your answer. I’ve already tried that…
As far as I understand from the official docs, and all my tries to accomplish this functionality, the snapshot object is a namespace scoped object, and cannot be shared between namespaces. Meaning that, both the snapshot object and the target mongodb instance which you want to restore from the snapshot, must be located in the same k8s namespace. If not, mongodb will complains that he cannot find the snapshot object it should restored/initilized from…


#4

Hi @Haim_Kabesa,

This is not expected behavior. Can you please file an issue here: https://github.com/kubedb/project ? We have to fix this.