Skip to content

Commit

Permalink
feat: Add a new default storage class that uses GP3 for storage (#298)
Browse files Browse the repository at this point in the history
* feat: Add a new default storage class that uses GP3 for storage
  • Loading branch information
danielpanzella authored Oct 7, 2024
1 parent 2f1982a commit 3f9c6d7
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions modules/app_eks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,38 @@ module "eks" {
}
}

resource "kubernetes_annotations" "gp2" {
api_version = "storage.k8s.io/v1"
kind = "StorageClass"
force = "true"
depends_on = [module.eks]

metadata {
name = "gp2"
}
annotations = {
"storageclass.kubernetes.io/is-default-class" = "false"
}
}

resource "kubernetes_storage_class" "gp3" {
metadata {
name = "gp3"
annotations = {
"storageclass.kubernetes.io/is-default-class" = "true"
}
}
depends_on = [kubernetes_annotations.gp2]
storage_provisioner = "kubernetes.io/aws-ebs"
parameters = {
fsType = "ext4"
type = "gp3"
}
reclaim_policy = "Delete"
volume_binding_mode = "WaitForFirstConsumer"
allow_volume_expansion = true
}

resource "aws_security_group" "primary_workers" {
name = "${var.namespace}-primary-workers"
description = "EKS primary workers security group."
Expand Down

0 comments on commit 3f9c6d7

Please sign in to comment.