Configure AWS EBS Volumes for Kubernetes

December 28, 2020

Standard

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: standard
provisioner: kubernetes.io/aws-ebs
reclaimPolicy: Delete
allowVolumeExpansion: true
parameters:
  type: gp2

IOPS Storage

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: iops
provisioner: kubernetes.io/aws-ebs
reclaimPolicy: Delete
allowVolumeExpansion: true
parameters:
  type: io1

Cold Storage

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: cold
provisioner: kubernetes.io/aws-ebs
reclaimPolicy: Delete
allowVolumeExpansion: true
parameters:
  type: sc1

Example usage

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  namespace: myapp
  name: myapp-data-dir-claim
spec:
  volumeMode: Filesystem
  storageClassName: iops
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 4Gi

Profile

Written by Dan Lynch an inventor and entrepreneur who loves the web —  follow him on twitter or github