Report this

What is the reason for this report?

How do you re-attach a persistent volume to a kubernetes cluster?

Posted on June 16, 2019

I created a volume for my kubernetes cluster using a persistent volume claim (PVC). I destroyed the cluster when I had finished using it, but kept the volume because it might be useful in future. I now want to create a new cluster and attach the existing volume.

How can I attach that volume to a new kubernetes cluster?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

+1

+1

We got similar issue, we snapshot old volume and deployed it on new volume in new cluster. Both needs to be on same datacenter or you try rsync by attaching volume manually to a droplet

Hey there! Quick update for you. This solution should work for you to use an existing volume.

https://github.com/digitalocean/csi-digitalocean/blob/master/examples/kubernetes/pod-single-existing-volume/README.md

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.