Using SSD persistent disks

This page explains how to create PersistentVolume resources that are backed by SSD persistent disks.

SSD persistent disks

By default, dynamically provisioned PersistentVolumes use the default StorageClass and are backed by standard hard disks. If you need faster SSDs, you can create a special StorageClass. The following manifest, named ssd-storageclass.yaml, describes a StorageClass named faster with an SSD persistent disk.PersistentVolumeClaims made with this StorageClass are backed by SSDs.

# ssd-storageclass.yaml
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: faster
provisioner: kubernetes.io/gce-pd
parameters:
  type: pd-ssd

To create a PersistentVolumeClaim named my-volume with the faster StorageClass, refer to the StorageClass in the claim's manifest. The following ssd-claim.yaml file shows you how to do this.

# ssd-claim.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: my-volume
spec:
  storageClassName: faster
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 30Gi

Use kubectl apply to create this StorageClass and PersistentVolumeClaim:

kubectl apply -f ssd-storageclass.yaml
kubectl apply -f ssd-claim.yaml