Skip to content

Commit

Permalink
AWS no longer has default storage class with K8s 1.30
Browse files Browse the repository at this point in the history
  • Loading branch information
dhoucgitter committed Sep 6, 2024
1 parent 8718e08 commit c689918
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,16 @@ module "kubeconfig" {
depends_on = [module.eks.cluster_name] # The name/id of the EKS cluster. Will block on cluster creation until the cluster is really ready.
}

# Restore the gp2 storage class as the default storage class for EKS 1.30 and later clusters
resource "terraform_data" "run_command" {
count = var.kubernetes_version >= "1.30" ? 1 : 0
provisioner "local-exec" {
command = "kubectl --kubeconfig=${local.kubeconfig_path} patch storageclass gp2 --patch '{\"metadata\": {\"annotations\":{\"storageclass.kubernetes.io/is-default-class\":\"true\"}}}' "
}

depends_on = [module.kubeconfig]
}

# Database Setup - https://registry.terraform.io/modules/terraform-aws-modules/rds/aws/6.2.0
module "postgresql" {
source = "terraform-aws-modules/rds/aws"
Expand Down

0 comments on commit c689918

Please sign in to comment.