feat(aws-eks): managed NodeGroup diskType support
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
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
Will scope the changes for the new module and come back.
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!
Closing this issue as nodegroup resource does not natively support that.
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.