Skip to content

Commit

Permalink
chore(eks): support Amazon Linux 2023 (#29335)
Browse files Browse the repository at this point in the history
### Issue # (if applicable)

Closes #29334

### Reason for this change

To support Amazon Linux 2023 nodegroup.

### Description of changes

Allow the AmiType to select Amazon Linux 2023 for both x86_64 and ARM_64.

### Description of how you validated changes

```ts

    const mastersRole = new iam.Role(this, 'AdminRole', {
      assumedBy: new iam.AccountRootPrincipal(),
    });

    const vpc = ec2.Vpc.fromLookup(this, 'Vpc', { isDefault: true });

    const cluster = new eks.Cluster(this, 'Cluster', {
      vpc,
      mastersRole,
      kubectlLayer: new KubectlV29Layer(this, 'KubectlLayer'),
      version: eks.KubernetesVersion.V1_29,
      defaultCapacity: 0,
    });

    cluster.addNodegroupCapacity('NG-X86', {
      amiType: eks.NodegroupAmiType.AL2023_X86_64_STANDARD,
      desiredSize: 1,
    });

    cluster.addNodegroupCapacity('NG-ARM', {
      amiType: eks.NodegroupAmiType.AL2023_ARM_64_STANDARD,
      desiredSize: 1,
    });

```

```sh
$ /tmp/kubectl get no
NAME                           STATUS   ROLES    AGE     VERSION
ip-172-31-1-222.ec2.internal   Ready    <none>   4m53s   v1.29.0-eks-5e0fdde
ip-172-31-2-242.ec2.internal   Ready    <none>   4m46s   v1.29.0-eks-5e0fdde
```

```
$ /tmp/kubectl get nodes ip-172-31-1-222.ec2.internal -o jsonpath="{
.status.nodeInfo}" | jq -r .
{
  "architecture": "amd64",
  "bootID": "f65b39c5-f1c6-4b75-8f62-8424c29302ca",
  "containerRuntimeVersion": "containerd://1.7.11",
  "kernelVersion": "6.1.77-99.164.amzn2023.x86_64",
  "kubeProxyVersion": "v1.29.0-eks-5e0fdde",
  "kubeletVersion": "v1.29.0-eks-5e0fdde",
  "machineID": "ec23037a57eb6be59d03137fbe1c2625",
  "operatingSystem": "linux",
  "osImage": "Amazon Linux 2023",
  "systemUUID": "ec23037a-57eb-6be5-9d03-137fbe1c2625"
}
$ /tmp/kubectl get nodes ip-172-31-2-242.ec2.internal -o jsonpath="{
.status.nodeInfo}" | jq -r .
{
  "architecture": "arm64",
  "bootID": "a2d15e6f-c48c-474b-aad5-510712c41153",
  "containerRuntimeVersion": "containerd://1.7.11",
  "kernelVersion": "6.1.77-99.164.amzn2023.aarch64",
  "kubeProxyVersion": "v1.29.0-eks-5e0fdde",
  "kubeletVersion": "v1.29.0-eks-5e0fdde",
  "machineID": "ec2b26d85fe443884398704c3b82887b",
  "operatingSystem": "linux",
  "osImage": "Amazon Linux 2023",
  "systemUUID": "ec2b26d8-5fe4-4388-4398-704c3b82887b"
}
```


### 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)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
pahud committed Mar 1, 2024
1 parent 0d6ef63 commit 6a2747c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/aws-cdk-lib/aws-eks/lib/managed-nodegroup.ts
Expand Up @@ -70,6 +70,14 @@ export enum NodegroupAmiType {
* Windows Full 2022 (x86-64)
*/
WINDOWS_FULL_2022_X86_64 = 'WINDOWS_FULL_2022_x86_64',
/**
* Amazon Linux 2023 (x86-64)
*/
AL2023_X86_64_STANDARD = 'AL2023_x86_64_STANDARD',
/**
* Amazon Linux 2023 (ARM-64)
*/
AL2023_ARM_64_STANDARD = 'AL2023_ARM_64_STANDARD',
}

/**
Expand Down

0 comments on commit 6a2747c

Please sign in to comment.