This topic explains how to install a Container Storage Interface (CSI) storage
driver on your clusters.

## Overview

By default, GKE on AWS provisions AWS
[EBS volumes](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volume-types.html)
using the default [StorageClass](https://docs.cloud.google.com/kubernetes-engine/multi-cloud/docs/aws/previous-generation/concepts/storage.md.txt).
If your workloads need use another type of storage volume, you can install a
compatible CSI driver to provide access to it.

The `Container Storage Interface` ([CSI](https://github.com/container-storage-interface/spec/blob/master/spec.md))
is an open standard API that gives Kubernetes workloads access to compliant
storage systems. CSI also enables the use of modern storage features such as
resizing and snapshots.

After installing a CSI driver, you need to create a Kubernetes
[StorageClass](https://kubernetes.io/docs/concepts/storage/storage-classes/).
You set the CSI driver as the provisioner for the StorageClass. Then you can
[set the StorageClass as default](https://docs.cloud.google.com/kubernetes-engine/multi-cloud/docs/aws/previous-generation/how-to/storage-class.md.txt#set_default),
or configure your workloads to use the StorageClass.
For an example of how to create a StatefulSet with a custom StorageClass,
see [Using StorageClasses with your workloads](https://docs.cloud.google.com/kubernetes-engine/multi-cloud/docs/aws/previous-generation/how-to/storage-class.md.txt#example_statefulset).

## Install a vendor's CSI driver

Storage vendors are responsible for providing installation instructions for
their CSI drivers. See the list of
[CSI drivers](https://kubernetes-csi.github.io/docs/drivers.html)
in the CSI documentation.

Follow the installation instructions for your CSI driver, and then continue with
the next steps on this page.

> [!IMPORTANT]
> **Important:** Google does not provide support or instructions for third-party drivers. Contact your storage vendor for support.

## Verify your driver installation

After you install a CSI driver, you can verify the installation by running
the following commands.

```bash
kubectl get csinodes \
  -o jsonpath='{range .items[*]} {.metadata.name}{": "} {range .spec.drivers[*]} {.name}{"\n"} {end}{end}'
```

## How to use a CSI driver

To use a CSI driver:

1. Create a custom [StorageClass](https://docs.cloud.google.com/kubernetes-engine/multi-cloud/docs/aws/previous-generation/how-to/storage-class.md.txt#custom)
   that refers to the driver in its `provisioner` field.

2. To provision storage, you can either:

   - Reference the StorageClass in a [StatefulSet](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/)'s `volumeClaimTemplates` specification.
   - [Set it as the cluster's default StorageClass](https://docs.cloud.google.com/kubernetes-engine/multi-cloud/docs/aws/previous-generation/how-to/storage-class.md.txt#set_default).

### Considerations for StorageClass backed by a CSI driver

When you create a StorageClass, consider the following:

- Check your CSI driver documentation for
  [driver-specific parameters](https://kubernetes.io/docs/concepts/storage/storage-classes/#the-storageclass-resource)
  that you provide to your StorageClass, including the provisioner name.

- You should name the StorageClass after its properties (such as `fast` or
  `highly-replicated`), rather than after the name of the specific driver or
  appliance behind it. When you name a StorageClass after its properties, you can
  create StorageClasses with the same name in different clusters and
  environments. Then configure your workloads to use the same StorageClass.

## What's next

- Create a [StorageClass](https://docs.cloud.google.com/kubernetes-engine/multi-cloud/docs/aws/previous-generation/how-to/storage-class.md.txt#custom) which references the CSI driver.