aws-cdk icon indicating copy to clipboard operation
aws-cdk copied to clipboard

feat(aws-eks): managed NodeGroup diskType support

Open bramk opened this issue 2 years ago • 5 comments

Describe the feature

Allow specifying volume type for root volumes of Managed NodeGroup EC2 instances.

Use Case

We want to move away from gp2 and use gp3 root devices when using EKS Managed NodeGroups.

Proposed Solution

Add a ‎EbsDeviceVolumeType? parameter "diskType" in managed-nodegroup that can override the current default gp2.

Other Information

There already is "diskSize". Also closely related to #9006.

Acknowledgements

  • [X] I may be able to implement this feature request
  • [ ] This feature might incur a breaking change

CDK version used

2.170.0

Environment details (OS name and version, etc.)

EKS 1.30 with standard AMIs

bramk avatar Dec 03 '24 14:12 bramk

Hi @bramk , thanks for requesting this. Currently, this diskType is not supported by Cloudformation as can be seen here -https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-eks-nodegroup.html#aws-resource-eks-nodegroup-properties.

but I also see this suggestion of providing support in case of EBS Encryption - https://github.com/aws/aws-cdk/issues/9006#issuecomment-1549268723 and using the EC2.LaunchTemplate for the same(same scenario holds true for NodeGroup DiskType AFAIU). So I think you might have to do the same as a workaround by incorporating the change in line.

So in this regard, I would mark this issue for input by the Core team for an approval on the process if this is something on their radar for future work or if they would like to share insights on the suggested mode of action.Hope that helps!

Thanks

khushail avatar Dec 03 '24 22:12 khushail

Will scope the changes for the new module and come back.

QuantumNeuralCoder avatar Feb 11 '25 00:02 QuantumNeuralCoder

Hi @QuantumNeuralCoder, @bramk,

Just wanted to check in on the status of this feature request. I've reviewed the current state of both aws-eks and aws-eks-v2-alpha modules, and confirmed that neither currently supports diskType for managed nodegroups.

I understand CloudFormation doesn't expose diskType directly on AWS::EKS::Nodegroup, so the implementation would likely need to automatically create/configure a Launch Template when users specify a diskType property.

For anyone else hitting this in the meantime, the workaround is to use a Launch Template:

const launchTemplate = new ec2.LaunchTemplate(this, 'LaunchTemplate', {
  blockDevices: [{
    deviceName: '/dev/xvda',
    volume: ec2.BlockDeviceVolume.ebs(20, {
      volumeType: ec2.EbsDeviceVolumeType.GP3,
    }),
  }],
});

cluster.addNodegroupCapacity('NodeGroup', {
  launchTemplateSpec: {
    id: launchTemplate.launchTemplateId!,
    version: launchTemplate.latestVersionNumber,
  },
});

Thanks!

pahud avatar Jan 24 '26 02:01 pahud

Closing this issue as nodegroup resource does not natively support that.

pahud avatar Jan 24 '26 02:01 pahud

Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one.

github-actions[bot] avatar Jan 24 '26 02:01 github-actions[bot]