|
|
|
@@ -13,7 +13,6 @@ weight: 20
|
|
|
|
|
|
|
|
|
|
<!-- overview -->
|
|
|
|
|
|
|
|
|
|
{{< feature-state for_k8s_version="v1.17" state="beta" >}}
|
|
|
|
|
In Kubernetes, a _VolumeSnapshot_ represents a snapshot of a volume on a storage system. This document assumes that you are already familiar with Kubernetes [persistent volumes](/docs/concepts/storage/persistent-volumes/).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -37,7 +36,8 @@ Users need to be aware of the following when using this feature:
|
|
|
|
|
|
|
|
|
|
* API Objects `VolumeSnapshot`, `VolumeSnapshotContent`, and `VolumeSnapshotClass` are {{< glossary_tooltip term_id="CustomResourceDefinition" text="CRDs" >}}, not part of the core API.
|
|
|
|
|
* `VolumeSnapshot` support is only available for CSI drivers.
|
|
|
|
|
* As part of the deployment process in the beta version of `VolumeSnapshot`, the Kubernetes team provides a snapshot controller to be deployed into the control plane, and a sidecar helper container called csi-snapshotter to be deployed together with the CSI driver. The snapshot controller watches `VolumeSnapshot` and `VolumeSnapshotContent` objects and is responsible for the creation and deletion of `VolumeSnapshotContent` object in dynamic provisioning. The sidecar csi-snapshotter watches `VolumeSnapshotContent` objects and triggers `CreateSnapshot` and `DeleteSnapshot` operations against a CSI endpoint.
|
|
|
|
|
* As part of the deployment process of `VolumeSnapshot`, the Kubernetes team provides a snapshot controller to be deployed into the control plane, and a sidecar helper container called csi-snapshotter to be deployed together with the CSI driver. The snapshot controller watches `VolumeSnapshot` and `VolumeSnapshotContent` objects and is responsible for the creation and deletion of `VolumeSnapshotContent` object. The sidecar csi-snapshotter watches `VolumeSnapshotContent` objects and triggers `CreateSnapshot` and `DeleteSnapshot` operations against a CSI endpoint.
|
|
|
|
|
* There is also a validating webhook server which provides tightened validation on snapshot objects. This should be installed by the Kubernetes distros along with the snapshot controller and CRDs, not CSI drivers. It should be installed in all Kubernetes clusters that has the snapshot feature enabled.
|
|
|
|
|
* CSI drivers may or may not have implemented the volume snapshot functionality. The CSI drivers that have provided support for volume snapshot will likely use the csi-snapshotter. See [CSI Driver documentation](https://kubernetes-csi.github.io/docs/) for details.
|
|
|
|
|
* The CRDs and snapshot controller installations are the responsibility of the Kubernetes distribution.
|
|
|
|
|
|
|
|
|
@@ -78,7 +78,7 @@ Deletion is triggered by deleting the `VolumeSnapshot` object, and the `Deletion
|
|
|
|
|
Each VolumeSnapshot contains a spec and a status.
|
|
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
|
apiVersion: snapshot.storage.k8s.io/v1beta1
|
|
|
|
|
apiVersion: snapshot.storage.k8s.io/v1
|
|
|
|
|
kind: VolumeSnapshot
|
|
|
|
|
metadata:
|
|
|
|
|
name: new-snapshot-test
|
|
|
|
@@ -97,7 +97,7 @@ using the attribute `volumeSnapshotClassName`. If nothing is set, then the defau
|
|
|
|
|
For pre-provisioned snapshots, you need to specify a `volumeSnapshotContentName` as the source for the snapshot as shown in the following example. The `volumeSnapshotContentName` source field is required for pre-provisioned snapshots.
|
|
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
|
apiVersion: snapshot.storage.k8s.io/v1beta1
|
|
|
|
|
apiVersion: snapshot.storage.k8s.io/v1
|
|
|
|
|
kind: VolumeSnapshot
|
|
|
|
|
metadata:
|
|
|
|
|
name: test-snapshot
|
|
|
|
@@ -111,7 +111,7 @@ spec:
|
|
|
|
|
Each VolumeSnapshotContent contains a spec and status. In dynamic provisioning, the snapshot common controller creates `VolumeSnapshotContent` objects. Here is an example:
|
|
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
|
apiVersion: snapshot.storage.k8s.io/v1beta1
|
|
|
|
|
apiVersion: snapshot.storage.k8s.io/v1
|
|
|
|
|
kind: VolumeSnapshotContent
|
|
|
|
|
metadata:
|
|
|
|
|
name: snapcontent-72d9a349-aacd-42d2-a240-d775650d2455
|
|
|
|
@@ -132,7 +132,7 @@ spec:
|
|
|
|
|
For pre-provisioned snapshots, you (as cluster administrator) are responsible for creating the `VolumeSnapshotContent` object as follows.
|
|
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
|
apiVersion: snapshot.storage.k8s.io/v1beta1
|
|
|
|
|
apiVersion: snapshot.storage.k8s.io/v1
|
|
|
|
|
kind: VolumeSnapshotContent
|
|
|
|
|
metadata:
|
|
|
|
|
name: new-snapshot-content-test
|
|
|
|
@@ -154,4 +154,4 @@ You can provision a new volume, pre-populated with data from a snapshot, by usin
|
|
|
|
|
the *dataSource* field in the `PersistentVolumeClaim` object.
|
|
|
|
|
|
|
|
|
|
For more details, see
|
|
|
|
|
[Volume Snapshot and Restore Volume from Snapshot](/docs/concepts/storage/persistent-volumes/#volume-snapshot-and-restore-volume-from-snapshot-support).
|
|
|
|
|
[Volume Snapshot and Restore Volume from Snapshot](/docs/concepts/storage/persistent-volumes/#volume-snapshot-and-restore-volume-from-snapshot-support).
|
|
|
|
|