Sub topic 12
CSI drivers and where storage actually comes from
This chapter assumes you know how PersistentVolumes, PersistentVolumeClaims, and StorageClasses relate, and that you have seen dynamic provisioning at a basic level. Here you will see which software creates the disk behind a claim.
What CSI is
Kubernetes does not know how to create an EBS volume, an NFS export, or a Ceph image. The Container Storage Interface (CSI) is a standard API that lets storage vendors supply that logic. A vendor ships a CSI driver, and Kubernetes calls it over gRPC. Older built-in plugins such as awsElasticBlockStore have been removed or redirected to CSI drivers, so new clusters should use CSI.
The provisioner field of a StorageClass names the driver:
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: fast
provisioner: ebs.csi.aws.com
parameters:
type: gp3
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: trueEverything under parameters is passed to the driver unchanged. Kubernetes does not validate it, so a typo there fails at provisioning time.
The two halves of a driver
A driver is installed as ordinary workloads in your cluster, usually in kube-system.
- Controller plugin: A Deployment or StatefulSet that talks to the storage backend. It creates, deletes, attaches, detaches, resizes, and snapshots volumes. Helper sidecar containers (
external-provisioner,external-attacher,external-resizer,external-snapshotter) watch Kubernetes objects and call the driver. - Node plugin: A DaemonSet that runs on every node. It formats the device and mounts it into the Pod's directory when the kubelet asks.
Inspecting what is installed
kubectl get csidrivers
kubectl get csinodes
kubectl get pods -n kube-system | grep -i csicsidrivers lists registered drivers. csinodes shows which drivers are registered on each node. A driver missing from a node's entry means its node plugin is not running or not registered there.
Common errors
| Symptom | Likely cause |
|---|---|
| PVC stays `Pending`, no events from a provisioner | The driver is not installed, or `provisioner` does not match the driver's name |
| Provisioning fails with a backend error | Wrong `parameters`, missing cloud permissions, or quota exhausted |
| Pod stuck in `ContainerCreating` | The node plugin is not running on that node, or the attach step failed |
| Resize or snapshot is rejected | The driver does not support that capability |
Exercise
A PVC that uses StorageClass fast stays Pending, and kubectl describe pvc shows no events at all. kubectl get csidrivers returns nothing. What is the most likely cause, and what do you do?
Show answer
No CSI driver is installed, so nothing watches for claims that name ebs.csi.aws.com and no provisioner reacts. Install the driver, including its controller and node plugins, with the vendor's manifests or Helm chart. Then confirm that kubectl get csidrivers lists it and that the claim binds.