Skip to content

Commit fc09bc1

Browse files
authored
feat(eks): support eks with k8s 1.31 (#31707)
### Issue # (if applicable) Closes #31695 ### Reason for this change - Similar to #30454, this PR adds 1.31 support. - Update all existing integ tests for V1_30 and make sure they deploy with V1_31. ### Description of changes ### 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 { KubectlV31Layer } from '@aws-cdk/lambda-layer-kubectl-v31'; 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_31, kubectlLayer: new KubectlV31Layer(this, 'KubectlLayer'), defaultCapacity: 1, }); } } const app = new App(); new EksClusterLatestVersion(app, 'v31-stack', { env: { account: process.env.CDK_DEFAULT_ACCOUNT, region: process.env.CDK_DEFAULT_REGION, }, }) ``` verify ```sh $ kubectl get no NAME STATUS ROLES AGE VERSION ip-10-0-183-173.ec2.internal Ready <none> 4m25s v1.31.0-eks-a737599 ``` ### 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 daaf0aa commit fc09bc1

File tree

31 files changed

+736
-693
lines changed

31 files changed

+736
-693
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"@aws-cdk/lambda-layer-kubectl-v24": "^2.0.242",
4343
"@aws-cdk/lambda-layer-kubectl-v29": "^2.1.0",
4444
"@aws-cdk/lambda-layer-kubectl-v30": "^2.0.1",
45+
"@aws-cdk/lambda-layer-kubectl-v31": "^2.0.0",
4546
"aws-cdk-lib": "0.0.0",
4647
"cdk8s": "2.69.0",
4748
"cdk8s-plus-27": "2.9.5",

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as lambda from 'aws-cdk-lib/aws-lambda';
22
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';
5+
import { KubectlV31Layer } from '@aws-cdk/lambda-layer-kubectl-v31';
56
import { Construct } from 'constructs';
67
import * as eks from 'aws-cdk-lib/aws-eks';
78

@@ -13,6 +14,7 @@ const versionMap: { [key: string]: new (scope: Construct, id: string) => lambda.
1314
'1.24': KubectlV24Layer,
1415
'1.29': KubectlV29Layer,
1516
'1.30': KubectlV30Layer,
17+
'1.31': KubectlV31Layer,
1618
};
1719

1820
export function getClusterVersionConfig(scope: Construct, version?: eks.KubernetesVersion) {
Lines changed: 1 addition & 1 deletion
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/asset.1eaf141d4012ab0977a33bdf864ebbc6aa869a607e97fab6cd231fe6ef503aec/index.js

Lines changed: 0 additions & 55 deletions
This file was deleted.

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

Lines changed: 0 additions & 184 deletions
This file was deleted.

0 commit comments

Comments
 (0)