There is a recommended way for doing this, but it’s not applicable for my case. Apparently the PV for my Bitnami Moodle cluster was provisioned with an in-tree persistent disk driver which does not support snapshots.
In order to make use of the volume snapshot feature, I have to delete then recreate my PV with a new storage class that has the CSI provisioner, which will be a disruptive change.Readmore
I can’t afford a service disruption at this point in time so I’m using the trusted cp
tool instead.
Let’s 🚀
The official approach
Using GKE’s volume snapshot feature
-
Create a VolumeSnapshotClass object to specify the CSI driver and deletionPolicy for your volume snapshots
-
Create a VolumeSnapshot object — a request to GKE to create a snapshot of an existing PersistentVolumeClaim object
-
Confirm that GKE created the VolumeSnapshotContents object
If empty - check GKE logs (filter for Warnings)
Of course that doesn’t work for me so I stopped here.
The cop-out solution
Using the plain old cp
and kubectl cp