Skip to content

Commit 3b193c1

Browse files
pahudLeonardo Gama
authored and
Leonardo Gama
committed
feat(eks): support for Kubernetes version 1.30 (aws#30454)
### Issue # (if applicable) - Similar to aws#29040, this PR adds 1.30 support. - Update all existing integ tests for `V1_29` and make sure they deploy with `V1_30`. DependOn: - [x] cdklabs/awscdk-asset-kubectl#838 - [x] cdklabs/awscdk-asset-kubectl#860 Closes aws#30443 ### Reason for this change ### Description of changes ### Description of how you validated changes ```ts 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(), }); // create eks.Cluster of the latest k8s version new eks.Cluster(this, 'Cluster', { vpc, mastersRole, version: eks.KubernetesVersion.V1_30, kubectlLayer: new KubectlV30Layer(this, 'KubectlLayer'), defaultCapacity: 1, }); } } ``` $ kubectl get no NAME STATUS ROLES AGE VERSION ip-172-31-3-166.ec2.internal Ready <none> 5m38s v1.30.0-eks-036c24b ### 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 22e6fa4 commit 3b193c1

File tree

44 files changed

+1785
-1760
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1785
-1760
lines changed

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

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"@aws-cdk/integ-tests-alpha": "0.0.0",
4242
"@aws-cdk/lambda-layer-kubectl-v24": "^2.0.242",
4343
"@aws-cdk/lambda-layer-kubectl-v29": "^2.0.0",
44+
"@aws-cdk/lambda-layer-kubectl-v30": "^2.0.0",
4445
"aws-cdk-lib": "0.0.0",
4546
"aws-sdk": "^2.1610.0",
4647
"aws-sdk-mock": "5.6.0",

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

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
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';
4+
import { KubectlV30Layer } from '@aws-cdk/lambda-layer-kubectl-v30';
45
import { Construct } from 'constructs';
56
import * as eks from 'aws-cdk-lib/aws-eks';
67

7-
const versionMap: { [key: string]: any } = {
8-
1.24: KubectlV24Layer,
9-
1.29: KubectlV29Layer,
8+
// This object maps Kubernetes version strings to their corresponding
9+
// KubectlLayerVersion constructor functions. This allows us to dynamically
10+
// create the appropriate KubectlLayerVersion instance based on the
11+
// Kubernetes version.
12+
const versionMap: { [key: string]: new (scope: Construct, id: string) => lambda.ILayerVersion } = {
13+
'1.24': KubectlV24Layer,
14+
'1.29': KubectlV29Layer,
15+
'1.30': KubectlV30Layer,
1016
};
1117

1218
export function getClusterVersionConfig(scope: Construct, version?: eks.KubernetesVersion) {
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: 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

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

Diff for: 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

+5-5
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": "b5925bba477fd1ac27c3a695a9f6ece293bd0ae6940bc65a5b99008ab54f60f7.zip"
437+
"S3Key": "bfbdea4d45250c8162c204fe0687cb775e24d61c895ad89e4ca6e9a7fc90b0f0.zip"
438438
},
439-
"Description": "/opt/kubectl/kubectl 1.29; /opt/helm/helm 3.14",
439+
"Description": "/opt/kubectl/kubectl 1.30; /opt/helm/helm 3.15",
440440
"LicenseInfo": "Apache-2.0"
441441
}
442442
},
@@ -755,7 +755,7 @@
755755
]
756756
},
757757
"Config": {
758-
"version": "1.29",
758+
"version": "1.30",
759759
"roleArn": {
760760
"Fn::GetAtt": [
761761
"ClusterRoleFA261979",
@@ -1090,7 +1090,7 @@
10901090
{
10911091
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
10921092
},
1093-
"/471fe4d6391a89009b531814efc9974653ad7582640370a65c9c1295e6f5e4bc.json"
1093+
"/f60bb443f247dda63ec8772a7627d54d50a56350ed4e8c906bc15e8272052a12.json"
10941094
]
10951095
]
10961096
}
@@ -1140,7 +1140,7 @@
11401140
{
11411141
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
11421142
},
1143-
"/b950d200e14479f797ff28cd9b5f20f6292b459a527fd88842f706bd93ec4e88.json"
1143+
"/5ae608f2a0d8bc3f9dbe5f1a3254a5e50e17eb42f6cf3459a3687bcd7f00db86.json"
11441144
]
11451145
]
11461146
}

Diff for: packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-al2023-nodegroup.js.snapshot/awscdkeksclusteral2023nodegrouptestawscdkawseksClusterResourceProviderE67D0702.nested.template.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"S3Bucket": {
88
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
99
},
10-
"S3Key": "9202bb21d52e07810fc1da0f6acf2dcb75a40a43a9a2efbcfc9ae39535c6260c.zip"
10+
"S3Key": "22de69e75b55e15d4d49905d8a4901edd66d1367f617c2a01ac6e86ca2b7eb84.zip"
1111
},
1212
"Description": "/opt/nodejs/node_modules/proxy-agent"
1313
}
@@ -50,7 +50,7 @@
5050
"S3Bucket": {
5151
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
5252
},
53-
"S3Key": "71aae489e8a9171b4e9c4ed9b264e3dad2dd3abfa40efb57071906931624ca52.zip"
53+
"S3Key": "98b432f1b1df9de4026df7e718c23783d833d67973da5291085b4dc7be1a568a.zip"
5454
},
5555
"Description": "onEvent handler for EKS cluster resource provider",
5656
"Environment": {
@@ -115,7 +115,7 @@
115115
"S3Bucket": {
116116
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
117117
},
118-
"S3Key": "71aae489e8a9171b4e9c4ed9b264e3dad2dd3abfa40efb57071906931624ca52.zip"
118+
"S3Key": "98b432f1b1df9de4026df7e718c23783d833d67973da5291085b4dc7be1a568a.zip"
119119
},
120120
"Description": "isComplete handler for EKS cluster resource provider",
121121
"Environment": {

Diff for: packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-al2023-nodegroup.js.snapshot/awscdkeksclusteral2023nodegrouptestawscdkawseksKubectlProvider3D3ED876.nested.template.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"S3Bucket": {
88
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
99
},
10-
"S3Key": "1471fa6f2876749a13de79989efc6651c9768d3173ef5904947e87504f8d7069.zip"
10+
"S3Key": "abc70c90ded969d12235ca11768293cb20557cff54518518480c0d9fb344a098.zip"
1111
},
1212
"Description": "onEvent handler for EKS kubectl resource provider",
1313
"Handler": "index.handler",

Diff for: 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.

0 commit comments

Comments
 (0)