Skip to content

Commit 5a1479b

Browse files
committed
Use kubectl to determine if feature is present
1 parent f89729d commit 5a1479b

File tree

1 file changed

+22
-7
lines changed

1 file changed

+22
-7
lines changed

content/en/docs/concepts/storage/volume-snapshots.md

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,16 +150,31 @@ spec:
150150

151151
`snapshotHandle` is the unique identifier of the volume snapshot created on the storage backend. This field is required for the pre-provisioned snapshots. It specifies the CSI snapshot id on the storage system that this `VolumeSnapshotContent` represents.
152152

153-
`sourceVolumeMode` is the mode of the volume whose snapshot is taken. The value of the `sourceVolumeMode` field can be either `Filesystem` or `Block`. If the source volume mode is not specified, Kubernetes treats the snapshot as if the source volume's mode is unknown. Support for this field can only be enabled in VolumeSnapshot client v6.0.0 and higher. Visit the [VolumeSnapshot Release page](https://github.com/kubernetes-csi/external-snapshotter/releases) for more information.
153+
`sourceVolumeMode` is the mode of the volume whose snapshot is taken. The value
154+
of the `sourceVolumeMode` field can be either `Filesystem` or `Block`. If the
155+
source volume mode is not specified, Kubernetes treats the snapshot as if the
156+
source volume's mode is unknown. Support for this field can only be enabled in
157+
`VolumeSnapshot` API v6.0.0 and higher. Visit the [VolumeSnapshot Release page](https://github.com/kubernetes-csi/external-snapshotter/releases) for more information.
154158

155159
## Converting the volume mode of a Snapshot {#convert-volume-mode}
156160

157-
This feature is only present for `VolumeSnapshotContents` created with client version `v6.0.0` onwards.
158-
The volume mode can be either `Filesystem` or `Block`. If not specified, it indicates the volume mode is unknown.
159-
If you want to allow users to create a `PersistentVolumeClaim` from an existing `VolumeSnapshot`, but with a
160-
different volume mode than the source, the annotation `snapshot.storage.kubernetes.io/allowVolumeModeChange: "true"`
161-
needs to be added to the `VolumeSnapshotContent` that corresponds to the `VolumeSnapshot`. For pre-provisioned snapshots,
162-
`Spec.SourceVolumeMode` needs to be populated by the cluster administrator.
161+
This feature is only present for `VolumeSnapshots` API with version `v6.0.0` onwards. To check if your
162+
cluster has capability for this feature, run the following command:
163+
164+
```yaml
165+
$ kubectl get crd volumesnapshotcontent -o yaml
166+
```
167+
168+
If a field called `sourceVolumeMode` is present in the output, then the API supports this feature.
169+
170+
If you want to allow users to create a `PersistentVolumeClaim` from an existing
171+
`VolumeSnapshot`, but with a different volume mode than the source, the annotation
172+
`snapshot.storage.kubernetes.io/allowVolumeModeChange: "true"`needs to be added to
173+
the `VolumeSnapshotContent` that corresponds to the `VolumeSnapshot`.
174+
175+
For pre-provisioned snapshots, `Spec.SourceVolumeMode` needs to be populated
176+
by the cluster administrator.
177+
163178
An example `VolumeSnapshotContent` resource with this feature enabled would look like:
164179

165180
```yaml

0 commit comments

Comments
 (0)