# Installing VolumeSnapshot CRDs

## Prerequisite

Before attempting to install VolumeSnapshot CRDs, it is important to confirm that the CRDs are not already present on the system. To do this, run the following command:

```
kubectl api-resources | grep volumesnapshot
```

If CRDs are already present, the output should be similar to the output displayed below. The second column displays the version of the CRD installed (v1beta1 in this case). Ensure that it is the correct version required by the CSI driver being used.

```
volumesnapshotclasses    snapshot.storage.k8s.io/v1beta1        false        VolumeSnapshotClass
volumesnapshotcontents   snapshot.storage.k8s.io/v1beta1        false        VolumeSnapshotContent
volumesnapshots          snapshot.storage.k8s.io/v1beta1        true         VolumeSnapshot
```

## Installing CRDs

{% hint style="info" %}

* Make sure to only install one version of VolumeSnapshot CRDs.
  {% endhint %}

1. Navigate and read the external-snapshotter GitHub project provided in the [Kubernetes documentation](https://github.com/kubernetes-csi/external-snapshotter/tree/release-5.0/client/config/crd). This is compatible with both v1.19 and v1.20+.
2. Run the following three commands to install directly:

```
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/release-5.0/client/config/crd/snapshot.storage.k8s.io_volumesnapshotclasses.yaml
```

```
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/release-5.0/client/config/crd/snapshot.storage.k8s.io_volumesnapshotcontents.yaml
```

```
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/release-5.0/client/config/crd/snapshot.storage.k8s.io_volumesnapshots.yaml
```

3\. Assuming successful execution of the commands above, the stated version of VolumeSnapshot CRDs should be available on the system. Check this by performing the [#prerequisite](#prerequisite "mention") step again.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.trilio.io/kubernetes/appendix/storage/csi-drivers/installing-volumesnapshot-crds.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
