From b1fb570bf52e8cb3ac38fafed8ab0b9b26b584c0 Mon Sep 17 00:00:00 2001 From: YuviPanda Date: Mon, 7 Aug 2023 09:11:19 -0700 Subject: [PATCH] Add gp3 storageclass We add this unconditionally to all clusters for simplification, so we can set storageClass: gp3 for new clusters that come up on AWS without issue. This doesn't change the default, and does not change the storageclass in existing clusters. In addition to using gp3, it also sets reclaimPolicy to Retain, so if the PVC is deleted, it does not delete the PV or the underlying EBS volume. Ref https://github.com/2i2c-org/infrastructure/issues/2906 Ref https://github.com/2i2c-org/infrastructure/issues/2717 --- .../support/templates/storageclass/gp3.yaml | 18 ++++++++++++++++++ .../templates/{ => storageclass}/pd-ssd.yaml | 0 2 files changed, 18 insertions(+) create mode 100644 helm-charts/support/templates/storageclass/gp3.yaml rename helm-charts/support/templates/{ => storageclass}/pd-ssd.yaml (100%) diff --git a/helm-charts/support/templates/storageclass/gp3.yaml b/helm-charts/support/templates/storageclass/gp3.yaml new file mode 100644 index 0000000000..326b6cb064 --- /dev/null +++ b/helm-charts/support/templates/storageclass/gp3.yaml @@ -0,0 +1,18 @@ +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: gp3 +# Use the AWS EBS CSI provisioner +provisioner: ebs.csi.aws.com +parameters: + # gp3 is cheaper than gp2 + type: gp3 + fsType: ext4 +# Do not delete the underlying EBS volume whenever this PV & PVC +# are deleted! This allows us recovery in case of accidental deletion +reclaimPolicy: Retain +# Create the EBS volume only when the pod consuming it tries to use it. +# This ensures the EBS volume is created in the correct *zone*, so we +# don't end up with issues where the volume is in a different zone (but +# same region) as our pods. +volumeBindingMode: WaitForFirstConsumer diff --git a/helm-charts/support/templates/pd-ssd.yaml b/helm-charts/support/templates/storageclass/pd-ssd.yaml similarity index 100% rename from helm-charts/support/templates/pd-ssd.yaml rename to helm-charts/support/templates/storageclass/pd-ssd.yaml