Skip to content

Commit 7379a4b

Browse files
authored
chore(eks): add AL2023_ARM_64_NVIDIA AMI type for managed node groups (#35578)
**Issue**: #35571 **Reason for this change:** AWS EKS now supports Amazon Linux 2023 with NVIDIA drivers for ARM64 architecture (`AL2023_ARM_64_NVIDIA`) for managed node groups, but this AMI type is not available in the CDK EKS constructs. Users who want to leverage ARM64-based GPU instances (like Graviton-based GPU instances) with the latest Amazon Linux 2023 optimized for NVIDIA workloads cannot specify this AMI type through CDK, forcing them to use CloudFormation directly or older AMI types. **Description of changes:** Add support for Amazon Linux 2023 with NVIDIA drivers on ARM64 architecture for EKS managed node groups: * **Add `AL2023_ARM_64_NVIDIA` to `NodegroupAmiType` enum**: New AMI type following the established naming convention * **Include in `gpuAmiTypes` array**: Ensures proper validation logic for GPU instance types * **Add comprehensive JSDoc documentation**: Describes the AMI as "Amazon Linux 2023 with NVIDIA drivers (ARM-64)" * **Maintain backward compatibility**: No breaking changes to existing functionality * **Follow established patterns**: Consistent with existing AMI type implementations The implementation enables users to specify ARM64 GPU instances with the latest Amazon Linux 2023 optimized for NVIDIA workloads: ```typescript new eks.Nodegroup(this, 'GpuNodeGroup', { cluster: cluster, amiType: eks.NodegroupAmiType.AL2023_ARM_64_NVIDIA, instanceTypes: [new ec2.InstanceType('g5g.xlarge')], // ARM64 GPU instance }); ``` **Description of how you validated changes:** * Unit Tests: All existing EKS tests pass without modifications, confirming no regressions **Checklist:** - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)
1 parent 89bfef7 commit 7379a4b

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

packages/@aws-cdk/aws-eks-v2-alpha/lib/managed-nodegroup.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ export enum NodegroupAmiType {
9494
* Amazon Linux 2023 with NVIDIA drivers (x86-64)
9595
*/
9696
AL2023_X86_64_NVIDIA = 'AL2023_x86_64_NVIDIA',
97+
/**
98+
* Amazon Linux 2023 with NVIDIA drivers (ARM-64)
99+
*/
100+
AL2023_ARM_64_NVIDIA = 'AL2023_ARM_64_NVIDIA',
97101
/**
98102
* Amazon Linux 2023 (ARM-64)
99103
*/
@@ -634,6 +638,7 @@ const gpuAmiTypes: NodegroupAmiType[] = [
634638
NodegroupAmiType.AL2_X86_64_GPU,
635639
NodegroupAmiType.AL2023_X86_64_NEURON,
636640
NodegroupAmiType.AL2023_X86_64_NVIDIA,
641+
NodegroupAmiType.AL2023_ARM_64_NVIDIA,
637642
NodegroupAmiType.BOTTLEROCKET_X86_64_NVIDIA,
638643
NodegroupAmiType.BOTTLEROCKET_ARM_64_NVIDIA,
639644
];

packages/@aws-cdk/aws-eks-v2-alpha/test/nodegroup.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ describe('node group', () => {
638638
new ec2.InstanceType('p3.large'),
639639
new ec2.InstanceType('g3.large'),
640640
],
641-
})).toThrow(/The specified AMI does not match the instance types architecture, either specify one of AL2_X86_64_GPU, AL2023_X86_64_NEURON, AL2023_X86_64_NVIDIA, BOTTLEROCKET_X86_64_NVIDIA, BOTTLEROCKET_ARM_64_NVIDIA or don't specify any/);
641+
})).toThrow(/The specified AMI does not match the instance types architecture, either specify one of AL2_X86_64_GPU, AL2023_X86_64_NEURON, AL2023_X86_64_NVIDIA, AL2023_ARM_64_NVIDIA, BOTTLEROCKET_X86_64_NVIDIA, BOTTLEROCKET_ARM_64_NVIDIA or don't specify any/);
642642
});
643643

644644
/**

packages/aws-cdk-lib/aws-eks/lib/managed-nodegroup.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ export enum NodegroupAmiType {
9494
* Amazon Linux 2023 with NVIDIA drivers (x86-64)
9595
*/
9696
AL2023_X86_64_NVIDIA = 'AL2023_x86_64_NVIDIA',
97+
/**
98+
* Amazon Linux 2023 with NVIDIA drivers (ARM-64)
99+
*/
100+
AL2023_ARM_64_NVIDIA = 'AL2023_ARM_64_NVIDIA',
97101
/**
98102
* Amazon Linux 2023 (ARM-64)
99103
*/
@@ -647,6 +651,7 @@ const gpuAmiTypes: NodegroupAmiType[] = [
647651
NodegroupAmiType.AL2_X86_64_GPU,
648652
NodegroupAmiType.AL2023_X86_64_NEURON,
649653
NodegroupAmiType.AL2023_X86_64_NVIDIA,
654+
NodegroupAmiType.AL2023_ARM_64_NVIDIA,
650655
NodegroupAmiType.BOTTLEROCKET_X86_64_NVIDIA,
651656
NodegroupAmiType.BOTTLEROCKET_ARM_64_NVIDIA,
652657
];

packages/aws-cdk-lib/aws-eks/test/nodegroup.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ describe('node group', () => {
665665
new ec2.InstanceType('p3.large'),
666666
new ec2.InstanceType('g3.large'),
667667
],
668-
})).toThrow(/The specified AMI does not match the instance types architecture, either specify one of AL2_X86_64_GPU, AL2023_X86_64_NEURON, AL2023_X86_64_NVIDIA, BOTTLEROCKET_X86_64_NVIDIA, BOTTLEROCKET_ARM_64_NVIDIA or don't specify any/);
668+
})).toThrow(/The specified AMI does not match the instance types architecture, either specify one of AL2_X86_64_GPU, AL2023_X86_64_NEURON, AL2023_X86_64_NVIDIA, AL2023_ARM_64_NVIDIA, BOTTLEROCKET_X86_64_NVIDIA, BOTTLEROCKET_ARM_64_NVIDIA or don't specify any/);
669669
});
670670

671671
/**

0 commit comments

Comments
 (0)