← Back to posts

GCP ACE: Persistent Storage in GKE — PersistentVolumes, Claims, and StorageClasses

Containers are disposable by design — but the StatefulSet article made the point that some workloads (databases especially) need storage that survives a Pod being deleted and recreated. This is the layer that provides it.

The three objects

ObjectWhat it is
PersistentVolume (PV)A cluster-level resource representing actual durable storage — in GKE, almost always a Compute Engine persistent disk. Its lifecycle is independent of any Pod: deleting a Pod does not delete the PV.
PersistentVolumeClaim (PVC)A request for storage: a size, an access mode, and (optionally) a StorageClass. Kubernetes binds it to a PV that satisfies it, or dynamically provisions a new one.
StorageClassA template that defines how a PV gets provisioned — which provisioner (the Compute Engine persistent disk CSI driver, in GKE’s case), disk type, and filesystem.

A Pod never talks to a PV directly — it mounts a PVC, and the PVC is bound to a PV behind the scenes.

How it maps to Compute Engine disks

Default behavior if you don’t specify a StorageClass

GKE ships a default StorageClass using the balanced persistent disk type with ext4. Any PVC that omits storageClassName gets this default automatically.

Two defaults worth memorizing:

Windows node pools are the one exception to all of this: ext4 isn’t supported there, so Windows workloads need an explicit StorageClass using NTFS.

Example

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: pvc-demo
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 30Gi
  storageClassName: standard-rwo

This requests 30 GiB that a single node can mount read-write. Setting storageClassName explicitly pins the claim to standard-rwo (the balanced persistent disk class backed by the Compute Engine PD CSI driver), regardless of which StorageClass is currently marked as the cluster default.

# referencing the PVC from a Pod
volumes:
- name: data
  persistentVolumeClaim:
    claimName: pvc-demo

Exam Takeaways

Sources

↗ LinkedIn