You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The driver points to OpenEBS Cstor CSI driver. The deletionPolicy can be set to `Delete` or `Retain`. When set to Retain, the underlying physical snapshot on the storage cluster is retained even when the VolumeSnapshot object is deleted.
36
+
The driver points to OpenEBS CStor CSI driver. The `deletionPolicy` can be set to `Delete` or `Retain`. When set to Retain, the underlying physical snapshot on the storage cluster is retained even when the VolumeSnapshot object is deleted.
37
+
38
+
#### Note: In some cluster like OpenShift(OCP) 4.5, which only installs the `v1beta1` version of `VolumeSnapshotClass` as supported version, then you may get the API error like:
39
+
40
+
```
41
+
$ kubectl apply -f snapshotclass.yaml
42
+
no matches for kind "VolumeSnapshotClass" in version "snapshot.storage.k8s.io/v1"
43
+
```
44
+
in such cases you can change the apiVersion to use `v1beta1` version instead of `v1` shown below:
To create a snapshot of a volume, here's an example of a YAML file that defines a snapshot:
43
60
44
61
```yaml
45
-
apiVersion: snapshot.storage.k8s.io/v1beta1
62
+
apiVersion: snapshot.storage.k8s.io/v1
46
63
kind: VolumeSnapshot
47
64
metadata:
48
65
name: cstor-pvc-snap
@@ -92,7 +109,24 @@ Status:
92
109
The `SnapshotContentName` identifies the `VolumeSnapshotContent` object which serves this snapshot. The Ready To Use parameter indicates that the Snapshot created successfully and
93
110
can be used to create a new PVC.
94
111
112
+
#### Note: In some cluster like OpenShift(OCP) 4.5, which only installs the `v1beta1` version of `VolumeSnapshots` as supported version, then you may get the API error like:
95
113
114
+
```
115
+
$ kubectl apply -f snapshot.yaml
116
+
no matches for kind "VolumeSnapshot" in version "snapshot.storage.k8s.io/v1"
117
+
```
118
+
in such cases you can change the apiVersion to use `v1beta1` version instead of `v1` shown below:
119
+
120
+
```yaml
121
+
apiVersion: snapshot.storage.k8s.io/v1beta1
122
+
kind: VolumeSnapshot
123
+
metadata:
124
+
name: cstor-pvc-snap
125
+
spec:
126
+
volumeSnapshotClassName: csi-cstor-snapshotclass
127
+
source:
128
+
persistentVolumeClaimName: cstor-pvc
129
+
```
96
130
97
131
### Create PVCs from VolumeSnapshots
98
132
@@ -118,14 +152,12 @@ spec:
118
152
119
153
The `dataSource` shows that the PVC must be created using a `VolumeSnapshot` named `cstor-pvc-snap` as the source of the data. This instructs CStor CSI to create a PVC from the snapshot. Once the PVC is created, it can be attached to a pod and used just like any other PVC.
120
154
121
-
```sh
122
-
123
155
124
156
5. Verify that the PVC has been successfully created:
157
+
125
158
```
126
159
kubectl get pvc
127
160
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
0 commit comments