aws-quickstart / cdk-eks-blueprints

AWS Quick Start Team
Apache License 2.0
454 stars 205 forks source link

GenericClusterProvider autoscalingNodeGroups should support Graviton #394

Open otterley opened 2 years ago

otterley commented 2 years ago

Describe the bug

GenericClusterProvider autoscalingNodeGroups should support Graviton. Currently it doesn't give the specify the correct AMI variant for the arm64 CPU architecture when creating the launch configuration.

Separately - though this is less important - the stack is creating a Launch Configuration instead of a Launch Template. Modern stacks should use EC2 Launch Templates as they have more flexibility and can be reused outside the Auto Scaling Group context.

Expected Behavior

Create a cluster using GenericClusterProvider with the following autoscalingNodeGroups attribute:

  autoscalingNodeGroups: [
    {
      id: 'c7g',
      instanceType: new InstanceType('c7g.xlarge'),
      machineImageType: MachineImageType.AMAZON_LINUX_2,

    }
  ]

And have the correct AMI for arm64 be used.

Current Behavior

An AMI for x86_64 was specified in the Launch Template instead, causing the scale-out to fail with the following error message:

Launching a new EC2 instance. Status Reason: The architecture 'arm64' of the specified instance type does not match the architecture 'x86_64' of the specified AMI. Specify an instance type and an AMI that have matching architectures, and try again. You can use 'describe-instance-types' or 'describe-images' to discover the architecture of the instance type or AMI. Launching EC2 instance failed.

Reproduction Steps

See above

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.23.0

EKS Blueprints Version

1.0.0

Node.js Version

v16.15.0

Environment details (OS name and version, etc.)

-

Other information

No response

elamaran11 commented 1 year ago

@otterley We have made rapid improvements to blueprints to support graviton. We have also created a new Blueprints GravitonBuilder for graviton with documentation to support Graviton Patterns. Please check this and let us know if this ticket can be closed.

otterley commented 1 year ago

I looked at GravitonBuilder, but it is unclear to me whether it fulfills the UX I described above.

GravitonBuilder appears to build an EKS cluster and attach a Graviton-based node group to it. But that's not how most customers use EKS clusters with Graviton. Instead, customers typically run a mix of Graviton and x86 nodes depending on their specific requirements. The might be in the midst of an architecture transition; they might want instance type flexibility (especially for workloads that run on Spot instances), and they might have pods that cannot be migrated to Graviton for historical or proprietary reasons.

Hence, this request is all about making it easier for customers to supply and attach both x86 and Graviton nodes to clusters as they deem fit.