How do I create a PVC from a Volume Snapshot to a Kubernetes cluster? It is tuck in "pending" state

Hey there! Wondering if I could get some help with a k8s, PVCs, and volume backup restoration.

Context Got an app in Cluster A with Postgres, which keeps data in a volume created via a PVC resource, and we’re migrating to a new Cluster B.

Versions Cluster A - Kubernetes 1.18.14-do.0 Cluster B - Kubernetes 1.20.2-do.0

What I want to do Use the PVC data from Cluster A and attach it to the app in Cluster B.

What I tried Created a backup snapshot of the volume from Cluster A and attempted to create a new PVC in Cluster B from it following the tutorial in

Cluster B - pvc.yaml

apiVersion: v1
kind: PersistentVolumeClaim
  name: pg-data
  namespace: pipeline
    environment: prod
    name: pg-data-backup
    kind: VolumeSnapshot
    - ReadWriteOnce
      storage: 1Gi # same size as that of the PVC from Cluster A 

What I am seeing The new PVC in Cluster B is stuck in Pending status, as shown below.

kubectl get persistentvolumeclaims -n pipeline

pg-data   Pending                                      do-block-storage   39m

Am I doing something wrong? Any ideas or guidance would be hugely appreciated.

Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

@careduz Would it be possible to simply upgrade Cluster A to Kubernetes 1.20.2-do.0 instead of trying to move your persistent volumes to Cluster B?

Think different and code well,