EKS with gp3 volumes

AWS encourages users to migrate from gp2 to gp3 for better performance and lower costs.
Simplified(very) comparison gp2 vs. gp3
Feature | gp2 | gp3 |
---|---|---|
Base Price (per GB) | $0.10 | $0.08 (20% cheaper) |
IOPS per GB | 3 IOPS/GB (size-dependent) | 3,000 IOPS included (fixed) |
Max IOPS | 16,000 | 16,000 (provisioned) |
Max Throughput | 250 MB/s (size-dependent) | 1,000 MB/s (provisioned) |
IOPS Scaling | Scales with size | Provisioned independently |
Use Cases | Simpler workloads, costlier for small IOPS needs | Higher performance at a lower price |
As a prerequisite it needs ebs-csi-controller
, it can be installed with eksctl
---
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
#<...>
addons:
#<...>
- name: aws-ebs-csi-driver
resolveConflicts: overwrite
configurationValues: |-
controller:
nodeSelector:
label: value
#<...>
New StorageClass for gp3 must be created:
cat > gp3.yaml<<EOF
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: gp3
provisioner: ebs.csi.aws.com
volumeBindingMode: WaitForFirstConsumer
EOF
.. and deployed:
kubectl apply -f gp3.yaml
Switch default StorageClass from gp2 to gp3
#unset default flag for gp2
kubectl patch storageclass gp2 -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"false"}}}'
#set default flag for gp3
kubectl patch storageclass gp2 -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'