AWS: Enable EBS GP3 for eks by default

AWS: Enable EBS GP3 for eks by default

By default when creating persistent volumes in AWS the GP2 type is created, however, for some time now we have had GP3 available, which provides us with different advantages, including cost savings. In the following table we can see a comparison of both versions:

Volume type

gp3 gp2

Volume size

1 GiB – 16 TiB

1 GiB – 16 TiB

Baseline IOPS

3000

3 IOPS/GiB (minimum 100 IOPS) to a maximum of 16,000 IOPS

Volumes smaller than 1 TiB can also burst up to 3,000 IOPS.

Max IOPS/volume

16,000

16,000

Baseline throughput

125 MiB/s

Throughput limit is between 128 MiB/s and 250 MiB/s, depending on the volume size.

Max throughput/volume

1,000 MiB/s

250 MiB/s

Price $0.08/GiB-month

3,000 IOPS free and

$0.005/provisioned IOPS-month over 3,000;

125 MiB/s free and

$0.04/provisioned MiB/s-month over 125MiB/s

$0.10/GiB-month

 

Here is a little howto on how we can change the default storageclass to Gp3 step by step.

Create IAM Role

Get OIDC provider url:

 

Create the following file to define the role by changing 111122223333 to our account ID, region-code to the aws region, and EXAMPLED539D4633E53DE1B71EXAMPLE with the value returned from the previous step:

 

Create the role with the file created previously:

 

Attach the policy to the role:

 

Create the identity provider from the aws console by following these steps:
1. Within IAM in the Access management section go to Identity provider – add provider – OpenID Connect
2. In the Provider URL add the url obtained in point 1.a
3. Click on Get thumbprint
4. In audience put “sts.amazonaws.com” and click on save

 

Install aws ebs-csi-controller driver

Create the following values.yaml

Add the helm repo:

Install helm chart:

Once all the previous steps have been followed, we will be able to observe how the default storageclass is of the gp3 type, and from now on all the volumes will be created using this type of ebs:

Leave a Reply

Your email address will not be published. Required fields are marked *