Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Blueprints, 02-at-scale] Set Topology for 1 AZ in Storage Class #51

Open
carlosrodlop opened this issue Jan 19, 2024 · 1 comment
Open
Labels
chore Maintenance

Comments

@carlosrodlop
Copy link
Collaborator

There are two option to prevent from posible node affinity conflict during controllers restarts when using EBS volumens: make topology aware volume to the same AZs, or designing Autoscaling Groups following what is explained in the AWS article Creating Kubernetes Auto Scaling Groups for Multiple Availability Zones (one ASG per AZ for EBS volume and one single ASG per Multiple AZ for EFS volumes). At the moment of publishing this blueprints, terraform-aws-modules/eks/aws does not support availability_zones atribute for the embedded aws_autoscaling_group resource, then the first option is applied in g3 Storage Class.

Only with setting g3 topology Storage Class is not enough. It is required to assigned Pod to 1 AZ only

@carlosrodlop carlosrodlop added the enhancement New feature or request label Jan 21, 2024
@carlosrodlop
Copy link
Collaborator Author

Possible modification in the main.tf

locals {
  az_a = ["${local.region}a"]
}

resource "kubernetes_storage_class_v1" "gp3" {
  metadata {
    name = "gp3"

    annotations = {
      "storageclass.kubernetes.io/is-default-class" = "true"
    }
  }

  storage_provisioner    = "ebs.csi.aws.com"
  allow_volume_expansion = true
  reclaim_policy         = "Delete"
  volume_binding_mode    = "WaitForFirstConsumer"

  parameters = {
    encrypted = "true"
    fsType    = "ext4"
    type      = "gp3"
  }

  allowed_topologies {
      match_label_expressions {
         key    = "topology.ebs.csi.aws.com/zone"
         values = local.az_a
     }
 }
}

@carlosrodlop carlosrodlop added chore Maintenance and removed enhancement New feature or request labels Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Maintenance
Projects
None yet
Development

No branches or pull requests

1 participant