fix(eks): missing support for "InstanceTypes" attribute assignment for AL2023 AMIs#29505
Conversation
aws-cdk-automation
left a comment
There was a problem hiding this comment.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.
aee3332 to
81ab615
Compare
| const arm64AmiTypes: NodegroupAmiType[] = [NodegroupAmiType.AL2_ARM_64, NodegroupAmiType.BOTTLEROCKET_ARM_64]; | ||
| const x8664AmiTypes: NodegroupAmiType[] = [NodegroupAmiType.AL2_X86_64, NodegroupAmiType.BOTTLEROCKET_X86_64, | ||
| const arm64AmiTypes: NodegroupAmiType[] = [NodegroupAmiType.AL2_ARM_64, NodegroupAmiType.AL2023_ARM_64_STANDARD, NodegroupAmiType.BOTTLEROCKET_ARM_64]; | ||
| const x8664AmiTypes: NodegroupAmiType[] = [NodegroupAmiType.AL2_X86_64, NodegroupAmiType.AL2023_X86_64_STANDARD, NodegroupAmiType.BOTTLEROCKET_X86_64, |
There was a problem hiding this comment.
It's the key to the issue, missing definitions for AmiType: AL2023_[ARM_64|X86_64]_STANDARD.
d87fba6 to
80f6bbc
Compare
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
80f6bbc to
a9dd543
Compare
a9dd543 to
a181afc
Compare
|
Thank you. This PR LGTM. Are you able to update the And you'll need to fix the CI before we can move this PR forward. |
a181afc to
c48d46b
Compare
c48d46b to
811afb5
Compare
| // THEN | ||
| expect(() => cluster.addNodegroupCapacity('ng', { | ||
| amiType: NodegroupAmiType.AL2023_X86_64_STANDARD, | ||
| instanceTypes: [ | ||
| new ec2.InstanceType('c6g.large'), | ||
| new ec2.InstanceType('t4g.large'), | ||
| ], | ||
| })).toThrow(/The specified AMI does not match the instance types architecture, either specify one of AL2_ARM_64, AL2023_ARM_64_STANDARD, BOTTLEROCKET_ARM_64 or don't specify any/); | ||
| }); |
There was a problem hiding this comment.
To ensure MNG with LT could capture invalid instance type exception.
| // THEN | ||
| expect(() => cluster.addNodegroupCapacity('ng', { | ||
| amiType: NodegroupAmiType.AL2023_ARM_64_STANDARD, | ||
| instanceTypes: [ | ||
| new ec2.InstanceType('m5.large'), | ||
| new ec2.InstanceType('c5.large'), | ||
| ], | ||
| })).toThrow(/The specified AMI does not match the instance types architecture, either specify one of AL2_X86_64, AL2023_X86_64_STANDARD, BOTTLEROCKET_X86_64, WINDOWS_CORE_2019_X86_64, WINDOWS_CORE_2022_X86_64, WINDOWS_FULL_2019_X86_64, WINDOWS_FULL_2022_X86_64 or don't specify any/); | ||
| }); |
There was a problem hiding this comment.
To ensure MNG with LT could capture invalid instance type exception.
| Ref: 'VPCPrivateSubnet2SubnetCFCDAA7A', | ||
| }, | ||
| ], | ||
| AmiType: 'AL2023_x86_64_STANDARD', |
There was a problem hiding this comment.
To ensure MNG could be created with no instance type specified.
| ]; | ||
| const x8664AmiTypes: NodegroupAmiType[] = [ | ||
| NodegroupAmiType.AL2_X86_64, | ||
| NodegroupAmiType.AL2023_X86_64_STANDARD, |
There was a problem hiding this comment.
It's the core to the issue, missing definition for AL2023.
| instanceTypes: [new ec2.InstanceType('m5.large')], | ||
| minSize: 4, | ||
| diskSize: 100, | ||
| amiType: eks.NodegroupAmiType.AL2_X86_64_GPU, |
There was a problem hiding this comment.
Reason for why removing this line
- The section here should focus on
addNodegroupCapacitybut notamiType. - Instance type here
m5.largedoes not supportGPUwhich is misleading.
18de6ee to
5d74fdb
Compare
| instanceTypes: [new ec2.InstanceType('m6g.medium')], // NOTE: if amiType is ARM-based image, the instance types here must be ARM-based. | ||
| amiType: eks.NodegroupAmiType.AL2023_ARM_64_STANDARD, | ||
| }); | ||
| ``` |
There was a problem hiding this comment.
Discussion: should we address AL2023 here? or maybe keep it as default AL2_ARM_64.
| // X86_64 based AMI managed node group | ||
| cluster.addNodegroupCapacity('custom-node-group', { | ||
| instanceTypes: [new ec2.InstanceType('m5.large')], // NOTE: if amiType is x86_64-based image, the instance types here must be x86_64-based. | ||
| amiType: eks.NodegroupAmiType.AL2023_X86_64_STANDARD, |
There was a problem hiding this comment.
Discussion: should we address AL2023 here? or maybe keep it as default AL2_X86_64.
5d74fdb to
0bee78e
Compare
|
@GavinZZ I've updated the As discussed with @pahud offline, I'm here leaving change for ARM64 Support section untouched as making change to I can see there are many
I think |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
@guessi can you please fix the merge conflict and this PR should be good to go. |
0bee78e to
86b3169
Compare
|
@GavinZZ Just rebased, should have no conflict now 👍 |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Issue # (if applicable)
Closes #29546
Reason for this change
After #29335,
@aws-eksshould receive AL2023 support, despites the GPU types are not yet supported it should at least allow user to customize instance type. However, missing support forNodegroupAmiType[]causing validation error emit, so that user can only create default instance types (t3.mediumort4g.medium).Description of changes
Add
eks.NodegroupAmiType.AL2023_X86_64_STANDARDandeks.NodegroupAmiType.AL2023_ARM_64_STANDARDsupport for node group module.Description of how you validated changes
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license