Skip to content

Commit

Permalink
doc(eks): fix(eks): update support for AL2023 nodegroups creation
Browse files Browse the repository at this point in the history
  • Loading branch information
guessi committed Mar 23, 2024
1 parent 811afb5 commit 18de6ee
Showing 1 changed file with 35 additions and 3 deletions.
38 changes: 35 additions & 3 deletions packages/aws-cdk-lib/aws-eks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ cluster.addNodegroupCapacity('custom-node-group', {
instanceTypes: [new ec2.InstanceType('m5.large')],
minSize: 4,
diskSize: 100,
amiType: eks.NodegroupAmiType.AL2_X86_64_GPU,
});
```

Expand All @@ -207,6 +206,24 @@ cluster.addNodegroupCapacity('custom-node-group', {
});
```

To define the type of the AMI for the node group, you may explicitly define `amiType` according to your requirements, supported amiType could be found [HERE](https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-eks/lib/managed-nodegroup.ts#L562-L565).

```ts
declare const cluster: eks.Cluster;

// 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,
});

// ARM_64 based AMI managed node group
cluster.addNodegroupCapacity('custom-node-group', {
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,
});
```

To define the maximum number of instances which can be simultaneously replaced in a node group during a version update you can set `maxUnavailable` or `maxUnavailablePercentage` options.

> For more details visit [Updating a managed node group](https://docs.aws.amazon.com/eks/latest/userguide/update-managed-node-group.html)
Expand Down Expand Up @@ -895,15 +912,30 @@ Amazon Linux 2 AMI for ARM64 will be automatically selected.

```ts
declare const cluster: eks.Cluster;
// add a managed ARM64 nodegroup

// add a managed ARM64 nodegroup with no amiType specified (default: AL2_ARM_64)
cluster.addNodegroupCapacity('extra-ng-arm', {
instanceTypes: [new ec2.InstanceType('m6g.medium')],
minSize: 2,
});

// add a self-managed ARM64 nodegroup
// add a managed ARM64 nodegroup with amiType explicitly set as AL2023_ARM_64_STANDARD
cluster.addNodegroupCapacity('extra-ng-arm-al2023', {
instanceTypes: [new ec2.InstanceType('m6g.medium')],
amiType: eks.NodegroupAmiType.AL2023_ARM_64_STANDARD,
minSize: 2,
});

// add a self-managed ARM64 nodegroup with no amiType specified (default: AL2_ARM_64)
cluster.addAutoScalingGroupCapacity('self-ng-arm', {
instanceType: new ec2.InstanceType('m6g.medium'),
minCapacity: 2,
})

// add a self-managed ARM64 nodegroup with amiType explicitly set as AL2023_ARM_64_STANDARD
cluster.addAutoScalingGroupCapacity('self-ng-arm', {
instanceType: new ec2.InstanceType('m6g.medium'),
amiType: eks.NodegroupAmiType.AL2023_ARM_64_STANDARD,
minCapacity: 2,
})
```
Expand Down

0 comments on commit 18de6ee

Please sign in to comment.