Home > Blockchain >  When is pre-provisioned VolumeSnapshot useful in Kubernetes?
When is pre-provisioned VolumeSnapshot useful in Kubernetes?

Time:08-30

I'm reading the Kubernetes documentation of VolumeSnapshot and VolumeSnapshotContent at https://kubernetes.io/docs/concepts/storage/volume-snapshots/. However, I was a little bit confused when I was reading the part of "pre-provisioned snapshots".

I can see that the resource VolumeSnapshot is created by the user, and it is the administrator's responsibility to create the corresponding VolumeSnapshotContent. In the "dynamically provisioned snapshots" scenario, a VolumeSnapshotContent will be automatically created right after a VolumeSnapshot is created with VolumeSnapshotClass, which was pre-configured by administrators. It makes sense to me.

However, in the scenario of "pre-provisioned snapshots", it seems that administrator has to create VolumeSnapshotContent before the user requests a snapshot with a VolumeSnapshot resource. In this case, I don't see how it's possible for the administrator to create a VolumeSnapshotContent. Which volume should be taken the snapshot? When should the snapshot be taken? These information should come from the user request, and there's no way that the administrator would know in advance. Therefore, the administrator can never create pre-provisioned snapshots.

I must have missed something. I appreciate if you can correct me. Thank you.

CodePudding user response:

I think there's a misunderstanding, "pre-provisioned" does not mean VolumeSnapshotContent is created before the snapshot request. Rather that the snapshot content was provisioned before registering the VolumeSnapshotContent into kubernetes

Later on, in the "binding" section, doc says:

In the case of pre-provisioned binding, the VolumeSnapshot will remain unbound until the requested VolumeSnapshotContent object is created.

End-user creates their VolumeSnapshot. Then admin proceeds with snapshotting data, and eventually registers a VSC and binds it to end-user's VolumeSnapshot.

  • Related