Skip to main content

Upgrade default storage class for EKS

This guide walks you through the steps to upgrade the default EBS volumes for your Amazon EKS clusters from gp2 to the superior gp3.

Prerequisites:

  • An Argonaut account
  • Have art CLI configured
  • Active EKS clusters (v1.17 or newer)
  • The corresponding version of kubectl (with authorization to install EBS CSI-related objects)

The default Storage Class (SC) defined for EKS clusters is of gp2 type. These aren’t the most efficient in terms of cost and performance. We recommend you upgrade to gp3. Here’s a comparison of the two. gp3 provides higher IOPS and throughput at a 20% lower cost per GB.

Accessing your cluster

Before we can interact with your EKS cluster, the first step is to set up local terminal access to your cluster using art CLI.

Follow the steps in this guide to obtain access to your cluster. Once done, you should be able to run the following kubectl commands.

Migrating from gp2 to gp3

This involves two steps.

  1. Removing the following annotation from the gp2 storage class, which will already be present on the cluster.

    metadata:
    annotations:
    storageclass.kubernetes.io/is-default-class: "true"

    This can be removed using the following kubectl command.

    kubectl annotate sc gp2 storageclass.kubernetes.io/is-default-class: "false"
  2. Paste the following code in a .yaml file and apply it to the cluster. This sets the default storage class as gp3.

    apiVersion: storage.k8s.io/v1
    kind: StorageClass
    metadata:
    annotations:
    storageclass.kubernetes.io/is-default-class: "true"
    name: gp3
    parameters:
    type: gp3
    provisioner: kubernetes.io/aws-ebs
    reclaimPolicy: Delete
    volumeBindingMode: WaitForFirstConsumer
    allowVolumeExpansion: true

    Now run the below command to apply the change.

    $ kubectl apply -f gp3-def-sc.yaml

    You’ll get a response: storageclass.storage.k8s.io/gp3 created

Once this is done, you can set storageClass: gp3 in your helm files.

Any new stateful apps that you spin up will make use of the gp3 storageclass version.

Argonaut will soon make gp3 the default for all new EKS clusters.