Manually install a CSI driver Stay organized with collections Save and categorize content based on your preferences.
This page explains how to install a Container Storage Interface (CSI) storagedriver on Google Kubernetes Engine (GKE) Standard clusters. This pagedoesn't apply to GKE Autopilot clusters, whichautomatically use theCompute Engine persistent disk CSI driver.
If you are using theCompute Engine persistent disk CSI driver in yourStandard cluster, we recommendautomatically deploying the driverto reduce your management overhead.
Overview
CSI is an open standard API that enables Kubernetes to expose arbitrary storagesystems to containerized workloads. Kubernetes volumes are managed byvendor-specific storage drivers, which have historically beencompiled into Kubernetes binaries.Previously, you could not use a storage driver that was not included withKubernetes. Installing a CSI driver adds support for a storage system that isnot natively supported by Kubernetes. Also, CSI enables the use of modernstorage features, such as snapshots and resizing.
Note: Google Distributed Cloud 1.5 does not support Kubernetes CSI snapshots.Installing a vendor's CSI driver
Other storage vendors develop their own CSI drivers, and they are responsible forproviding installation instructions. In simple cases, installation might onlyinvolve deploying manifests to your clusters. See the list ofCSIdrivers in theCSI documentation.
Note: Google does not provide support for, nor instructions for installing,other vendors' drivers.Verifying a driver installation
After you install a CSI driver, you can verify the installation by running oneof the following commands, depending on your cluster's GKEversion:
1.14+
kubectl get csinodes \-o jsonpath='{range .items[*]} {.metadata.name}{": "} {range .spec.drivers[*]} {.name}{"\n"} {end}{end}'1.13.x
kubectl get nodes \-o jsonpath='{.items[*].metadata.annotations.csi\.volume\.kubernetes\.io\/nodeid}'Using a CSI driver
To use a CSI driver:
Create a KubernetesStorageClass that references the driver in its
provisionerfield, if a StorageClass isnot created for you as part of driver installation. Some CSI drivers deploya StorageClass when you install them.To provision storage, you can either:
- Reference the StorageClass in the
volumeClaimTemplatesspecification foraStatefulSet object. - Set it as the cluster's default StorageClass.
- Reference the StorageClass in the
Considerations for StorageClasses backed by a CSI driver
When you create a StorageClass, consider the following:
- CSI driver documentation should include thedriver-specific parameters that you provide to your StorageClass, including the provisioner name.
- You should name the StorageClass after its properties, rather than after thename of the specific driver or appliance behind it. Naming the StorageClassafter its properties allows you to create StorageClasses with the same nameacross multiple clusters and environments, and allows your applications to getstorage with the same properties across clusters.
Example: Reference StorageClass in a StatefulSet
The following example models how to define a CSI driver in a StorageClass, andthen reference the StorageClass in aStatefulSet workload. The example assumes the driver has already been installed to thecluster.
The following is a simple StorageClass namedpremium-rwo that uses a fictionalCSI driver,csi.example.com, as its provisioner:
# fast-sc.yamlapiVersion:storage.k8s.io/v1kind:StorageClassmetadata:name:premium-rwoprovisioner:csi.example.com# CSI driverparameters:# You provide vendor-specific parameters to this specificationtype:example-parameter# Be sure to follow the vendor's instructionsdatastore:my-datastorereclaimPolicy:RetainallowVolumeExpansion:trueYou reference the StorageClass in a StatefulSet'svolumeClaimTemplatesspecification.
When you reference a StorageClass in a StatefulSet'svolumeClaimTemplatesspecification, Kubernetes provides stable storage using PersistentVolumes.Kubernetes calls the provisioner defined in the StorageClass to create a newstorage volume. In this case, Kubernetes calls the fictionalcsi.example.comprovider, which calls out to the provider's API, to create a volume. After thevolume is provisioned, Kubernetes automatically creates a PersistentVolume torepresent the storage.
Here is a simple StatefulSet that references the StorageClass:
# statefulset.yamlapiVersion:apps/v1kind:StatefulSetmetadata:name:webspec:replicas:2selector:matchLabels:app:nginxtemplate:metadata:labels:app:nginxspec:containers:-name:nginximage:registry.k8s.io/nginx-slim:0.8volumeMounts:-name:wwwmountPath:/usr/share/nginx/htmlvolumeClaimTemplates:# This is the specification in which you reference the StorageClass-metadata:name:wwwspec:accessModes:["ReadWriteOnce"]resources:requests:storage:1GistorageClassName:premium-rwo# This field references the existing StorageClassWhat's next
- Learn more about GKEstorage concepts.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-18 UTC.