liveBook · Manning

StorageClass

As explained in Effective Platform Engineering

A storage class is a Kubernetes resource that describes a category of storage and the provisioner and parameters used to create it dynamically.

A StorageClass is a Kubernetes resource that defines a category of storage, its provisioner, and the parameters used to create storage dynamically. It turns common storage needs into standard platform capabilities rather than requiring each team to manage underlying storage. section 7.4.5 section 8.4.1

A platform can begin with a small set of managed defaults. This implementation provides EBS and EFS classes for common persistent-volume-claim types, while deferring user self-service customization until demand justifies an operator or broader extension. section 7.4.5 section 8.4.1

AWS-backed default classes

The EBS class uses the EBS CSI provisioner, waits for the first consumer, permits volume expansion, and requests encrypted XFS io1 volumes. The EFS class uses the EFS CSI provisioner, an existing file system, access points, and PVC-based directory paths with unique directories. section 7.4.5

...

cat <<EOF > tpl/ebs-csi-storage-class.yaml
---
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: ${cluster_name}-ebs-csi-dynamic-storage
provisioner: ebs.csi.aws.com
volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: true
Parameters:
  csi.storage.k8s.io/fstype: xfs
  type: io1
  iopsPerGB: "50"
  encrypted: "true"
EOF
cat <<EOF > tpl/efs-csi-storage-class.yaml
---
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: ${cluster_name}-efs-csi-dynamic-storage
provisioner: efs.csi.aws.com
parameters:
  provisioningMode: efs-ap
  fileSystemId: $eks_efs_csi_storage_id
  directoryPerms: "700"
  basePath: "/dynamic_storage"
  subPathPattern: \${.PVC.namespace}/\${.PVC.name}  #1
  ensureUniqueDirectory: "true"
  reuseAccessPoint: "false"
EOF

kubectl apply -f tpl/ebs-csi-storage-class.yaml
kubectl apply -f tpl/efs-csi-storage-class.yaml

Inspect the concrete StorageClass manifests and their provisioning parameters. section 7.4.5

How Effective Platform Engineering covers it

How deep it goes
Defines concrete EBS and EFS manifests and parameters, but defers customized self-service storage provisioning.
Examples
Uses encrypted XFS io1 EBS volumes and EFS access points organized by PVC namespace and name.
What you can do after
Operate/configure standard EBS and EFS provisioning by applying cluster-specific StorageClass manifests.
How it connects
Connects Kubernetes API extensions, persistent volume claims, CSI provisioners, EBS, and EFS.

Also explained in

Compare how 4 books explain StorageClass →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Effective Platform Engineering. The section links point to the parts of the book it draws on.