This topic explains how to install a Container Storage Interface (CSI) storage driver on your user clusters.
Overview
By default, Anthos clusters on AWS provisions AWS EBS volumes using the default StorageClass. If you want to use another type of storage volume, you can install a CSI driver.
CSI is an open standard API that enables Kubernetes to expose arbitrary storage systems to containerized workloads. Also, CSI enables the use of modern storage features, such as and resizing and snapshots (in 1.17 and higher).
After installing a CSI driver, you need to create a Kubernetes StorageClass. You set the CSI driver as the provisioner for the StorageClass. Then, you can set the StorageClass as 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.
Before you begin
- From your
anthos-aws
directory, useanthos-gke
to switch context to your user cluster.cd anthos-aws env HTTP_PROXY=http://localhost:8118 \ anthos-gke aws clusters get-credentials CLUSTER_NAME
Installing a vendor's CSI driver
Storage vendors are responsible for providing installation instructions for their CSI drivers. See the list of CSI drivers in the CSI documentation.
Follow the installation instructions for your CSI driver, and then continue with the next steps on this page.
Verifying your driver installation
After you install a CSI driver, you can verify the installation by running the following commands.
env HTTP_PROXY=http://localhost:8118 \
kubectl get csinodes \
-o jsonpath='{range .items[*]} {.metadata.name}{": "} {range .spec.drivers[*]} {.name}{"\n"} {end}{end}'
Using a CSI driver
To use a CSI driver:
Create a custom StorageClass which references the driver in its
provisioner
field.To provision storage, you can either:
- Reference the StorageClass in a
StatefulSet's
volumeClaimTemplates
specification. - Set it as the cluster's default StorageClass.
- Reference the StorageClass in a
StatefulSet's
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 that you provide to your StorageClass, including the provisioner name.
You should name the StorageClass after its properties (such as
fast
orhighly-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 which references the CSI driver.