I have a small cluster on GKE, and I use dynamic provisioning to allocate persistent disks for Postgres. These disks are snapshotted on a regular schedule. When an accident happens, what's the best way to overwrite the contents of a dynamically created disk with the contents of a snapshot? I considered just deleting the disk and creating a new one with the same name, based on the snapshot. But since the disk is created and managed by k8s I'm worried that messing with it manually will break things.
I settled on creating a new instance, outside of k8s, attaching the target disk and a new one based on the snapshot to it, and using
dd to copy the data, but this is much slower than I'd like it to be. (~38MB/s)
Is there a better way?