Kubernetes way or Operator to clone PV between namespaces

2/17/2022

Please tell me the best way to clone PV between namespaces. I read that cloning is only possible in a single namespace.

So far the best way I see is to explicitly copy the files from one folder to another after creating the PVC.

But I would like to create one PV and use it as a template for deployments. I use Longhorn for disk management.

Thanks.

-- JDev
kubernetes
kubernetes-pvc
longhorn

1 Answer

2/17/2022

Such functionality is not yet supported. There is some work done (Add proposal for transfer of VolumeSnapshot #2849 ) for similar feature, but it's not yet ready.

As of today, explicitly copying files is your best bet.

-- p10l
Source: StackOverflow