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
Terminal window kubectl apply -f moodle-cluster-volumesnapshotclass.yaml -
Create a VolumeSnapshot object — a request to GKE to create a snapshot of an existing PersistentVolumeClaim object
Terminal window kubectl apply -f volumesnapshot.yaml -
Confirm that GKE created the VolumeSnapshotContents object
If empty - check GKE logs (filter for Warnings)
Terminal window kubectl get volumesnapshotcontents
Of course that doesn’t work for me so I stopped here.
The cop-out solution
Using the plain old cp
and kubectl cp
#In the podcp -r /bitnami/moodle /opt/bitnami/bitnami-20230401/moodlecp -r /bitnami/moodledata /opt/bitnami/bitnami-20230401/moodledatacd /opt/bitnamizip -r bitnami-20230401.zip bitnami-20230401
#In my PCkubectl cp moodle-6fb54cb979-zhm7k:/opt/bitnami/bitnami-20230401.zip .