Skip to content

Commit 3490d2e

Browse files
authored
feat(eks): support eks with k8s 1.32 (#33339)
### Issue # (if applicable) Closes #33254 ### Reason for this change - Similar to #31707, this PR adds 1.32 support. - Update all existing integ tests for V1_31 and make sure they deploy with V1_32. ### Description of changes ### Describe any new or updated permissions being added ### Description of how you validated changes ```ts import * as ec2 from 'aws-cdk-lib/aws-ec2'; import * as iam from 'aws-cdk-lib/aws-iam'; import { App, Stack, StackProps } from 'aws-cdk-lib'; import { KubectlV32Layer } from '@aws-cdk/lambda-layer-kubectl-v32'; import * as eks from 'aws-cdk-lib/aws-eks'; import { Construct } from 'constructs'; export class EksClusterLatestVersion extends Stack { constructor(scope: Construct, id: string, props: StackProps) { super(scope, id, props); const vpc = new ec2.Vpc(this, 'Vpc', { natGateways: 1 }); const mastersRole = new iam.Role(this, 'Role', { assumedBy: new iam.AccountRootPrincipal(), }); new eks.Cluster(this, 'Cluster', { vpc, mastersRole, version: eks.KubernetesVersion.V1_32, kubectlLayer: new KubectlV32Layer(this, 'KubectlLayer'), defaultCapacity: 1, }); } } const app = new App(); new EksClusterLatestVersion(app, 'v32-stack', { env: { account: process.env.CDK_DEFAULT_ACCOUNT, region: process.env.CDK_DEFAULT_REGION, }, }); app.synth(); ``` verify ``` pahud@MBP framework-integ % kubectl get no NAME STATUS ROLES AGE VERSION ip-172-31-3-173.ec2.internal Ready <none> 5m21s v1.32.0-eks-aeac579 % kubectl get po -n kube-system NAME READY STATUS RESTARTS AGE aws-node-r6jw8 2/2 Running 2 (9m35s ago) 12m coredns-6b9575c64c-75csr 1/1 Running 1 (9m35s ago) 16m coredns-6b9575c64c-hwpdd 1/1 Running 1 (9m35s ago) 16m kube-proxy-9w95h 1/1 Running 1 (9m35s ago) 12m ``` ### 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*
1 parent 2637d46 commit 3490d2e

17 files changed

+78
-61
lines changed

packages/@aws-cdk-testing/framework-integ/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,16 @@
3535
"@aws-sdk/client-acm": "3.632.0",
3636
"@aws-sdk/client-rds": "3.632.0",
3737
"@aws-sdk/client-s3": "3.632.0",
38-
"delay": "5.0.0",
39-
"axios": "1.7.8"
38+
"axios": "1.7.8",
39+
"delay": "5.0.0"
4040
},
4141
"dependencies": {
4242
"@aws-cdk/integ-tests-alpha": "0.0.0",
4343
"@aws-cdk/lambda-layer-kubectl-v24": "^2.0.242",
4444
"@aws-cdk/lambda-layer-kubectl-v29": "^2.1.0",
4545
"@aws-cdk/lambda-layer-kubectl-v30": "^2.0.1",
4646
"@aws-cdk/lambda-layer-kubectl-v31": "^2.0.0",
47+
"@aws-cdk/lambda-layer-kubectl-v32": "^2.0.1",
4748
"aws-cdk-lib": "0.0.0",
4849
"cdk8s": "2.69.10",
4950
"cdk8s-plus-27": "2.9.5",

packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ-tests-kubernetes-version.ts

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { KubectlV24Layer } from '@aws-cdk/lambda-layer-kubectl-v24';
33
import { KubectlV29Layer } from '@aws-cdk/lambda-layer-kubectl-v29';
44
import { KubectlV30Layer } from '@aws-cdk/lambda-layer-kubectl-v30';
55
import { KubectlV31Layer } from '@aws-cdk/lambda-layer-kubectl-v31';
6+
import { KubectlV32Layer } from '@aws-cdk/lambda-layer-kubectl-v32';
67
import { Construct } from 'constructs';
78
import * as eks from 'aws-cdk-lib/aws-eks';
89

@@ -15,6 +16,7 @@ const versionMap: { [key: string]: new (scope: Construct, id: string) => lambda.
1516
'1.29': KubectlV29Layer,
1617
'1.30': KubectlV30Layer,
1718
'1.31': KubectlV31Layer,
19+
'1.32': KubectlV32Layer,
1820
};
1921

2022
export function getClusterVersionConfig(scope: Construct, version?: eks.KubernetesVersion) {

packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-al2023-nodegroup.js.snapshot/asset.f3c812b299b0759c937b41e39d3451f5cc61279c2ec9ee791fac08ba1e56508b.zip

-3
This file was deleted.

packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-al2023-nodegroup.js.snapshot/aws-cdk-eks-cluster-al2023-nodegroup-test.assets.json

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-al2023-nodegroup.js.snapshot/aws-cdk-eks-cluster-al2023-nodegroup-test.template.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -434,9 +434,9 @@
434434
"S3Bucket": {
435435
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
436436
},
437-
"S3Key": "f3c812b299b0759c937b41e39d3451f5cc61279c2ec9ee791fac08ba1e56508b.zip"
437+
"S3Key": "2e670e0c40dc05a34d602c35c948edefcb81afaeea05b9f6240341173af6164e.zip"
438438
},
439-
"Description": "/opt/kubectl/kubectl 1.31.0; /opt/helm/helm 3.16.1",
439+
"Description": "/opt/kubectl/kubectl 1.32.0; /opt/helm/helm 3.17.0",
440440
"LicenseInfo": "Apache-2.0"
441441
}
442442
},
@@ -755,7 +755,7 @@
755755
]
756756
},
757757
"Config": {
758-
"version": "1.31",
758+
"version": "1.32",
759759
"roleArn": {
760760
"Fn::GetAtt": [
761761
"ClusterRoleFA261979",

packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-al2023-nodegroup.js.snapshot/manifest.json

+5-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-al2023-nodegroup.js.snapshot/tree.json

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-al2023-nodegroup.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class EksClusterStack extends Stack {
2727
vpc: this.vpc,
2828
mastersRole,
2929
defaultCapacity: 0,
30-
...getClusterVersionConfig(this, eks.KubernetesVersion.V1_31),
30+
...getClusterVersionConfig(this, eks.KubernetesVersion.V1_32),
3131
});
3232

3333
// create nodegroup with AL2023_X86_64_STANDARD

0 commit comments

Comments
 (0)