Skip to content

(eks): Unable to use Bottlerocket for managed nodegroup #17641

@juissi-t

Description

@juissi-t

What is the problem?

I'm trying to set up a new nodegroup which uses Bottlerocket. It fails with the following error:

Error: The specified AMI does not match the instance types architecture, either specify AL2_x86_64 or dont specify any

Reproduction Steps

import { App, Stack } from '@aws-cdk/core';
import { InstanceType } from '@aws-cdk/aws-ec2';
import { Cluster, KubernetesVersion, NodegroupAmiType } from '@aws-cdk/aws-eks';

const cluster = new Cluster(new Stack(new App()), 'eks-test-cluster', {
  version: KubernetesVersion.V1_21,
});
cluster.addNodegroupCapacity('bottlerocket', {
  instanceTypes: [new InstanceType('m5a.xlarge')],
  amiType: NodegroupAmiType.BOTTLEROCKET_X86_64,
});

What did you expect to happen?

I should not get an error and the nodegroup should be able to use Bottlerocket.

What actually happened?

I get the error mentioned above.

CDK CLI Version

1.133.0 (build 2dea31a)

Framework Version

No response

Node.js Version

v16.13.0

OS

Linux

Language

Typescript

Language Version

4.0.5

Other information

Looks like https://github.com/aws/aws-cdk/blob/v1.133.0/packages/@aws-cdk/aws-eks/lib/managed-nodegroup.ts#L367 checks that the given AMI type matches the expected AMI type. getAmiType calls getAmiTypeForInstanceType, which only lists NodegroupAmiType.AL2_X86_64 as the default version, and not the Bottlerocket enums at all.

Metadata

Metadata

Labels

@aws-cdk/aws-eksRelated to Amazon Elastic Kubernetes ServicebugThis issue is a bug.effort/smallSmall work item – less than a day of effortp1

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions