Home > other >  How to set AWS EKS nodes to use gp3
How to set AWS EKS nodes to use gp3

Time:07-16

I'm trying to set my EKS nodes to use gp3 as volume. It's using the default gp2 but I would like to change it to gp3. I'm using terraform to build the infrastructure and the aws_eks_cluster resource (I'm not using the module "eks"). Here is a simple snippet:

resource "aws_eks_cluster" "cluster" {
  name     = var.name
  role_arn = aws_iam_role.cluster.arn
  version  = var.k8s_version
}


resource "aws_eks_node_group" "cluster" {
  capacity_type   = var.node_capacity_type
  cluster_name    = aws_eks_cluster.cluster.name
  disk_size       = random_id.node_group.keepers.node_disk
  instance_types  = split(",", random_id.node_group.keepers.node_type)
  node_group_name = "${var.name}-${local.availability_zones[count.index]}-${random_id.node_group.hex}"
  node_role_arn   = random_id.node_group.keepers.role_arn
  subnet_ids      = [var.private ? aws_subnet.private[count.index].id : aws_subnet.public[count.index].id]
  version         = var.k8s_version
}

I tried to set up the kubernetes_storage_class resource but it's only changing for volumes used by the pods (PV/PVC). I would like to change the nodes volume to gp3.

I didn't find in the documentation and in the github how to do that. Was anyone able to do that?

Thanks.

CodePudding user response:

You can try to setup your own launch template and then reference it in aws_eks_node_group - launch_template argument.

Launch template allows you to configure disk type. AWS provides guide on how to write a launch template correctly.

  • Related