
September 11, 2026
11 min read
By Kokil Thapa | Last reviewed: September 2026
Persistent storage breaks many first Kubernetes deployments. Pods restart, but data vanishes because nothing outside the container holds it. CSI Drivers Explained starts with the standard fix: the Container Storage Interface, a vendor-neutral plugin model that lets any block or file backend attach volumes to pods. If you run stateful apps on managed clusters or self-hosted nodes, CSI drivers are how storage actually works in 2026. This guide maps the architecture, install flow, cloud choices, and the failures I see on real production clusters — including patterns that overlap with Linux system administration for Kubernetes hosts.
What is a CSI driver and why does Kubernetes need it?
Before CSI, each cloud volume type lived inside the Kubernetes core tree. AWS EBS, GCE PD, and Azure Disk code shipped with kube-controller-manager. That coupling slowed releases and made third-party storage awkward to support.
The Container Storage Interface specification splits storage into out-of-tree plugins. A CSI driver runs as Deployments or DaemonSets in your cluster. It registers with kubelet and the external-provisioner sidecar. Kubernetes calls the driver through standard RPC methods instead of hard-coded cloud logic.
In practice, you gain three wins. Storage vendors ship fixes without waiting for a Kubernetes minor release. You can run the same CSI pattern on AWS, Azure, on-prem Ceph, or NFS. Deprecated in-tree drivers are removed — GCE PD, OpenStack Cinder, and vSphere in-tree code were dropped in favour of CSI equivalents.
Stateful workloads — databases, Redis, document stores, queue backends — depend on this chain. A Laravel app with file uploads on local disk is a poor fit for ephemeral pod storage. Move uploads to S3 or mount a ReadWriteMany volume when multiple replicas need shared files. That design choice shows up often in enterprise application development projects where uptime and data durability matter.
How does the CSI driver architecture work in Kubernetes?
A full CSI deployment splits into identity, controller, and node services. Each exposes gRPC endpoints. Sidecar containers bridge those endpoints to Kubernetes APIs.
Core CSI components
- Identity service — reports driver name and supported capabilities.
- Controller service — creates, deletes, snapshots, and expands volumes.
- Node service — stages and publishes volumes on the worker node filesystem.
- Sidecars — external-provisioner, attacher, resizer, snapshotter, liveness-probe, node-driver-registrar.
When you apply a PersistentVolumeClaim, the external-provisioner watches PVC objects. It reads the StorageClass, calls CreateVolume on the CSI controller, and creates a PersistentVolume object. The attach-resizer sidecar handles volume attachment to the node and online expansion when allowed.
On the node, kubelet calls NodeStageVolume and NodePublishVolume. The block device or NFS export appears under the pod path. From the app view, it is just a directory or mount point.
Volume access modes still matter. ReadWriteOnce binds one node at a time — typical for MySQL on a block volume. ReadWriteMany needs a file protocol like NFS, EFS, or Azure Files. Pick the wrong mode and the scheduler will leave your pod pending forever.
For deeper cloud-specific trade-offs, see the companion write-up on EBS CSI vs Azure Disk CSI. It compares latency, cost, and snapshot behaviour on the two largest clouds.
Which CSI drivers should you use for AWS, Azure, and GCP?
Managed Kubernetes often ships a default StorageClass backed by the cloud CSI driver. Self-managed clusters require explicit install. The table below covers the drivers most teams touch in 2026.
| Platform | CSI Driver | Volume Type | Access Modes | Best For |
|---|---|---|---|---|
| AWS EKS | aws-ebs-csi-driver | Block (gp3, io2) | RWO | MySQL, PostgreSQL, Redis |
| AWS EKS | aws-efs-csi-driver | NFS file | RWX | Shared uploads, WordPress multi-replica |
| Azure AKS | azuredisk-csi-driver | Managed Disk | RWO | Single-replica databases |
| Azure AKS | azurefile-csi-driver | SMB/NFS file | RWX | Legacy apps needing shared storage |
| GCP GKE | pd.csi.storage.gke.io | Persistent Disk | RWO | General block workloads |
| On-prem / hybrid | Rook-Ceph, Longhorn, NFS CSI | Block or file | RWO / RWX | Clusters without hyperscaler disks |
Block CSI drivers excel at database latency. File CSI drivers excel at shared content. On a WooCommerce or multi-pod Laravel queue setup, shared file storage avoids sync headaches — a pattern I have applied on eCommerce platforms with persistent media directories.
Managed offerings simplify ops. EKS and AKS can enable the CSI driver as an add-on. GKE uses CSI by default for new clusters. Self-hosted k3s or kubeadm clusters need Helm or manifest installs plus IAM or cloud credentials on the node.
How do you install and configure a CSI driver on a cluster?
Installation varies by cloud, but the pattern repeats. Install driver manifests, create IAM or service principal bindings, define a StorageClass, then test with a PVC. Below is a practical AWS EBS CSI flow on EKS. Adapt the credential step for Azure or GCP.
Install the AWS EBS CSI driver
- Enable the EKS add-on or apply the upstream Helm chart.
- Attach an IAM policy allowing
ec2:CreateVolume,ec2:AttachVolume, and related calls to the controller service account. - Create a StorageClass pointing at
ebs.csi.aws.com. - Apply a test PVC and Pod, then confirm the volume attaches.
# Add EKS managed add-on (replace cluster name and role ARN)
aws eks create-addon \
--cluster-name production-cluster \
--addon-name aws-ebs-csi-driver \
--service-account-role-arn arn:aws:iam::123456789012:role/AmazonEKS_EBS_CSI_DriverRole
# StorageClass for gp3 volumes
kubectl apply -f - <<'EOF'
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: gp3-retain
provisioner: ebs.csi.aws.com
parameters:
type: gp3
fsType: ext4
reclaimPolicy: Retain
volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: true
EOF
# Test PVC + busybox pod
kubectl apply -f - <<'EOF'
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: csi-test-pvc
spec:
accessModes:
- ReadWriteOnce
storageClassName: gp3-retain
resources:
requests:
storage: 10Gi
---
apiVersion: v1
kind: Pod
metadata:
name: csi-test-pod
spec:
containers:
- name: app
image: busybox
command: ["sh", "-c", "echo ok > /data/test.txt; sleep 3600"]
volumeMounts:
- name: data
mountPath: /data
volumes:
- name: data
persistentVolumeClaim:
claimName: csi-test-pvc
EOF
Set volumeBindingMode: WaitForFirstConsumer when volumes must land in the same AZ as the pod. Without it, a PVC in ap-south-1a can bind a disk in ap-south-1b. The pod then stays unschedulable. Nepal-hosted workloads on ap-south-1 (Mumbai) hit this often when teams skip AZ-aware binding.
Helm charts from the Kubernetes CSI project documentation cover Longhorn, NFS, and vendor drivers with the same sidecar bundle. Pin chart versions in Git like any other infra artefact. Treat driver upgrades like a server provisioning change — test in staging first.
Observability hooks matter too. CSI sidecars expose metrics compatible with Prometheus. Wire alerts before production cutover, similar to patterns in Alertmanager-based cluster alerting.
What are common CSI driver problems and how do you fix them?
CSI failures usually show up as Pending PVCs, FailedAttachVolume events, or mount errors in kubelet logs. The fixes are repetitive once you know the signatures.
Diagnosis checklist
- PVC Pending forever — no default StorageClass, wrong provisioner name, or missing CSI controller pods.
- FailedAttachVolume — volume stuck on old node after crash; force detach in cloud console or use
volumeAttachmentcleanup. - Permission denied on mount — SELinux context, wrong fsType, or node plugin not registered with kubelet.
- Multi-AZ scheduling failure — block volume and pod in different availability zones.
- Snapshot restore fails — snapshot class not installed or driver lacks snapshot capability.
# Quick triage commands
kubectl get storageclass
kubectl get pvc -A | grep Pending
kubectl get pods -n kube-system | grep csi
kubectl describe pvc csi-test-pvc
kubectl get volumeattachment
kubectl logs -n kube-system -l app=ebs-csi-controller -c csi-provisioner --tail=50
I've seen Laravel apps "lose" user uploads after deploy because developers used emptyDir instead of a PVC. The pod recycled and the directory vanished. The fix was a ReadWriteMany file CSI mount for storage/app/public plus an S3 offload for large media — cheaper and more durable than oversized NFS for every file.
Reclaim policies deserve attention. Delete removes the cloud disk when the PVC goes away — fine for cache tiers. Retain keeps the disk for manual recovery — safer for production databases. Document which StorageClasses use which policy so junior ops do not wipe data during a namespace cleanup.
CSI snapshots enable backup automation. Define a VolumeSnapshotClass, schedule snapshots with Velero or your backup tool, and test restore quarterly. A snapshot you have never restored is wishful thinking, not a backup strategy. Pair this with ongoing support and maintenance if your team lacks dedicated SRE capacity.
Multi-cloud teams should read active-active vs active-passive multi-cloud before assuming one CSI driver config ports everywhere. Block volumes do not migrate across clouds; snapshots and object storage do.
For YAML and manifest debugging, a JSON and YAML formatter saves time when comparing Helm output against applied cluster state.
Logging drivers solve a different problem — container stdout — but the ops mindset matches. See Docker logging drivers for the parallel plugin model on single hosts before you scale to Kubernetes.
Modern platforms also treat storage metrics as part of AIOps-driven infrastructure monitoring. Watch attach latency and provisioning error rates, not just CPU.
Key Takeaways
- CSI drivers replace in-tree Kubernetes volume code with out-of-tree gRPC plugins for every major cloud and many on-prem backends.
- Match volume type to access mode: block + RWO for databases, file + RWX for shared application directories.
- Install the controller and node plugin, bind cloud IAM, define StorageClasses, then validate with a test PVC before production.
- Use WaitForFirstConsumer binding on block volumes to avoid cross-AZ attach failures.
- Monitor CSI sidecar logs and VolumeAttachment objects when PVCs or pods stay Pending.
- Set reclaimPolicy deliberately — Delete for disposable data, Retain for production databases you cannot afford to lose.
People Also Ask
What is the difference between in-tree and CSI storage in Kubernetes?
In-tree drivers compiled storage logic into Kubernetes itself. CSI drivers run as separate pods with a standard API. CSI is the only supported path for new features like volume expansion and snapshots on most platforms. In-tree AWS, GCE, and Azure code is deprecated or removed in current releases.
Do I need to install a CSI driver on managed Kubernetes?
Most managed clusters include a default block CSI driver. You still configure StorageClasses, sizes, and reclaim policies. File storage (EFS, Azure Files) and snapshot classes usually need a separate install or add-on enable step.
Can one PVC be mounted by multiple pods at once?
Only with ReadWriteMany and a file-based CSI driver such as NFS or EFS. Block CSI volumes with ReadWriteOnce allow a single node writer. Attempting multiple mounts on RWO causes scheduling or attach errors.
How do CSI drivers relate to StatefulSets?
StatefulSets use volumeClaimTemplates to create one PVC per replica. Each PVC binds through the StorageClass to a CSI-provisioned disk. Pod identity stays stable, so ordered startup and persistent data work together for databases and queues.
Plan persistent storage before your next deploy
CSI Drivers Explained is not academic trivia. It is the layer that keeps databases, uploads, and queue data alive when pods move, scale, or crash. Pick the right driver, bind credentials correctly, and test restore paths before you need them. If you are standing up stateful workloads on Kubernetes for a Laravel app, WordPress stack, or custom platform, map storage in the architecture phase — not after the first data loss.
I help teams design deploy pipelines, storage classes, and production clusters alongside application code — the same full-stack scope behind sites like Notary Kathmandu on shared Deployer and CI infrastructure. For greenfield platforms, see custom software development. For performance and reliability audits on live clusters, testing and optimization covers the operational side.
Need hands-on help choosing CSI drivers, StorageClasses, or a migration off ephemeral storage? Contact us with your cluster platform and workload type — block database, shared files, or hybrid — and we can outline a concrete storage plan.
Frequently Asked Questions
0 Comments
Leave a comment
Your email is not published. Comments appear once they have been read. Sign in to have your details filled in.

