Skip to content

Commit 9dfabb1

Browse files
authored
feat(eks): support for Kubernetes version 1.29 (#29040)
Similar to #27930, this PR adds eks with k8s 1.29 support. Addresses #28872 thread. Closes #28983. ### **!! Depends on cdklabs/awscdk-asset-kubectl#546 being merged in first. !!** /cc @kaizencc @pahud ### Reason for this change K8s 1.29 on EKS has been released on 1/23/2024. See: https://aws.amazon.com/blogs/containers/amazon-eks-now-supports-kubernetes-version-1-29/ ### Description of changes Added support for eks 1.29. ### Description of how you validated changes Deployed an EKS cluster with k8s 1.29. ![image](https://github.com/aws/aws-cdk/assets/31543/ba770020-2087-498a-a1eb-3e890df05062) ### 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 7fcd5be commit 9dfabb1

File tree

3 files changed

+40
-31
lines changed

3 files changed

+40
-31
lines changed

packages/aws-cdk-lib/aws-eks/README.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ This example defines an Amazon EKS cluster with the following configuration:
6363
* A Kubernetes pod with a container based on the [paulbouwer/hello-kubernetes](https://github.com/paulbouwer/hello-kubernetes) image.
6464

6565
```ts
66-
import { KubectlV28Layer } from '@aws-cdk/lambda-layer-kubectl-v28';
66+
import { KubectlV29Layer } from '@aws-cdk/lambda-layer-kubectl-v29';
6767

6868
// provisioning a cluster
6969
const cluster = new eks.Cluster(this, 'hello-eks', {
70-
version: eks.KubernetesVersion.V1_28,
71-
kubectlLayer: new KubectlV28Layer(this, 'kubectl'),
70+
version: eks.KubernetesVersion.V1_29,
71+
kubectlLayer: new KubectlV29Layer(this, 'kubectl'),
7272
});
7373

7474
// apply a kubernetes manifest to the cluster
@@ -134,15 +134,15 @@ Creating a new cluster is done using the `Cluster` or `FargateCluster` construct
134134

135135
```ts
136136
new eks.Cluster(this, 'HelloEKS', {
137-
version: eks.KubernetesVersion.V1_28,
137+
version: eks.KubernetesVersion.V1_29,
138138
});
139139
```
140140

141141
You can also use `FargateCluster` to provision a cluster that uses only fargate workers.
142142

143143
```ts
144144
new eks.FargateCluster(this, 'HelloEKS', {
145-
version: eks.KubernetesVersion.V1_28,
145+
version: eks.KubernetesVersion.V1_29,
146146
});
147147
```
148148

@@ -166,7 +166,7 @@ At cluster instantiation time, you can customize the number of instances and the
166166

167167
```ts
168168
new eks.Cluster(this, 'HelloEKS', {
169-
version: eks.KubernetesVersion.V1_28,
169+
version: eks.KubernetesVersion.V1_29,
170170
defaultCapacity: 5,
171171
defaultCapacityInstance: ec2.InstanceType.of(ec2.InstanceClass.M5, ec2.InstanceSize.SMALL),
172172
});
@@ -178,7 +178,7 @@ Additional customizations are available post instantiation. To apply them, set t
178178

179179
```ts
180180
const cluster = new eks.Cluster(this, 'HelloEKS', {
181-
version: eks.KubernetesVersion.V1_28,
181+
version: eks.KubernetesVersion.V1_29,
182182
defaultCapacity: 0,
183183
});
184184

@@ -262,7 +262,7 @@ const eksClusterNodeGroupRole = new iam.Role(this, 'eksClusterNodeGroupRole', {
262262
});
263263

264264
const cluster = new eks.Cluster(this, 'HelloEKS', {
265-
version: eks.KubernetesVersion.V1_28,
265+
version: eks.KubernetesVersion.V1_29,
266266
defaultCapacity: 0,
267267
});
268268

@@ -405,7 +405,7 @@ The following code defines an Amazon EKS cluster with a default Fargate Profile
405405

406406
```ts
407407
const cluster = new eks.FargateCluster(this, 'MyCluster', {
408-
version: eks.KubernetesVersion.V1_28,
408+
version: eks.KubernetesVersion.V1_29,
409409
});
410410
```
411411

@@ -482,7 +482,7 @@ You can also configure the cluster to use an auto-scaling group as the default c
482482

483483
```ts
484484
const cluster = new eks.Cluster(this, 'HelloEKS', {
485-
version: eks.KubernetesVersion.V1_28,
485+
version: eks.KubernetesVersion.V1_29,
486486
defaultCapacityType: eks.DefaultCapacityType.EC2,
487487
});
488488
```
@@ -586,7 +586,7 @@ You can configure the [cluster endpoint access](https://docs.aws.amazon.com/eks/
586586

587587
```ts
588588
const cluster = new eks.Cluster(this, 'hello-eks', {
589-
version: eks.KubernetesVersion.V1_28,
589+
version: eks.KubernetesVersion.V1_29,
590590
endpointAccess: eks.EndpointAccess.PRIVATE, // No access outside of your VPC.
591591
});
592592
```
@@ -608,7 +608,7 @@ To deploy the controller on your EKS cluster, configure the `albController` prop
608608

609609
```ts
610610
new eks.Cluster(this, 'HelloEKS', {
611-
version: eks.KubernetesVersion.V1_28,
611+
version: eks.KubernetesVersion.V1_29,
612612
albController: {
613613
version: eks.AlbControllerVersion.V2_6_2,
614614
},
@@ -651,7 +651,7 @@ You can specify the VPC of the cluster using the `vpc` and `vpcSubnets` properti
651651
declare const vpc: ec2.Vpc;
652652

653653
new eks.Cluster(this, 'HelloEKS', {
654-
version: eks.KubernetesVersion.V1_28,
654+
version: eks.KubernetesVersion.V1_29,
655655
vpc,
656656
vpcSubnets: [{ subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS }],
657657
});
@@ -698,7 +698,7 @@ You can configure the environment of the Cluster Handler functions by specifying
698698
```ts
699699
declare const proxyInstanceSecurityGroup: ec2.SecurityGroup;
700700
const cluster = new eks.Cluster(this, 'hello-eks', {
701-
version: eks.KubernetesVersion.V1_28,
701+
version: eks.KubernetesVersion.V1_29,
702702
clusterHandlerEnvironment: {
703703
https_proxy: 'http://proxy.myproxy.com',
704704
},
@@ -740,7 +740,7 @@ for (let subnet of subnets) {
740740
}
741741

742742
const cluster = new eks.Cluster(this, 'hello-eks', {
743-
version: eks.KubernetesVersion.V1_28,
743+
version: eks.KubernetesVersion.V1_29,
744744
vpc: vpc,
745745
ipFamily: eks.IpFamily.IP_V6,
746746
vpcSubnets: [{ subnets: vpc.publicSubnets }],
@@ -775,7 +775,7 @@ You can configure the environment of this function by specifying it at cluster i
775775

776776
```ts
777777
const cluster = new eks.Cluster(this, 'hello-eks', {
778-
version: eks.KubernetesVersion.V1_28,
778+
version: eks.KubernetesVersion.V1_29,
779779
kubectlEnvironment: {
780780
'http_proxy': 'http://proxy.myproxy.com',
781781
},
@@ -795,11 +795,11 @@ Depending on which version of kubernetes you're targeting, you will need to use
795795
the `@aws-cdk/lambda-layer-kubectl-vXY` packages.
796796

797797
```ts
798-
import { KubectlV28Layer } from '@aws-cdk/lambda-layer-kubectl-v28';
798+
import { KubectlV29Layer } from '@aws-cdk/lambda-layer-kubectl-v29';
799799

800800
const cluster = new eks.Cluster(this, 'hello-eks', {
801-
version: eks.KubernetesVersion.V1_28,
802-
kubectlLayer: new KubectlV28Layer(this, 'kubectl'),
801+
version: eks.KubernetesVersion.V1_29,
802+
kubectlLayer: new KubectlV29Layer(this, 'kubectl'),
803803
});
804804
```
805805

@@ -834,7 +834,7 @@ const cluster1 = new eks.Cluster(this, 'MyCluster', {
834834
kubectlLayer: layer,
835835
vpc,
836836
clusterName: 'cluster-name',
837-
version: eks.KubernetesVersion.V1_28,
837+
version: eks.KubernetesVersion.V1_29,
838838
});
839839

840840
// or
@@ -852,7 +852,7 @@ By default, the kubectl provider is configured with 1024MiB of memory. You can u
852852
```ts
853853
new eks.Cluster(this, 'MyCluster', {
854854
kubectlMemory: Size.gibibytes(4),
855-
version: eks.KubernetesVersion.V1_28,
855+
version: eks.KubernetesVersion.V1_29,
856856
});
857857

858858
// or
@@ -891,7 +891,7 @@ When you create a cluster, you can specify a `mastersRole`. The `Cluster` constr
891891
```ts
892892
declare const role: iam.Role;
893893
new eks.Cluster(this, 'HelloEKS', {
894-
version: eks.KubernetesVersion.V1_28,
894+
version: eks.KubernetesVersion.V1_29,
895895
mastersRole: role,
896896
});
897897
```
@@ -941,7 +941,7 @@ You can use the `secretsEncryptionKey` to configure which key the cluster will u
941941
const secretsKey = new kms.Key(this, 'SecretsKey');
942942
const cluster = new eks.Cluster(this, 'MyCluster', {
943943
secretsEncryptionKey: secretsKey,
944-
version: eks.KubernetesVersion.V1_28,
944+
version: eks.KubernetesVersion.V1_29,
945945
});
946946
```
947947

@@ -951,7 +951,7 @@ You can also use a similar configuration for running a cluster built using the F
951951
const secretsKey = new kms.Key(this, 'SecretsKey');
952952
const cluster = new eks.FargateCluster(this, 'MyFargateCluster', {
953953
secretsEncryptionKey: secretsKey,
954-
version: eks.KubernetesVersion.V1_28,
954+
version: eks.KubernetesVersion.V1_29,
955955
});
956956
```
957957

@@ -995,7 +995,7 @@ To access the Kubernetes resources from the console, make sure your viewing prin
995995
in the `aws-auth` ConfigMap. Some options to consider:
996996

997997
```ts
998-
import { KubectlV28Layer } from '@aws-cdk/lambda-layer-kubectl-v28';
998+
import { KubectlV29Layer } from '@aws-cdk/lambda-layer-kubectl-v29';
999999
declare const cluster: eks.Cluster;
10001000
declare const your_current_role: iam.Role;
10011001
declare const vpc: ec2.Vpc;
@@ -1015,7 +1015,7 @@ your_current_role.addToPolicy(new iam.PolicyStatement({
10151015

10161016
```ts
10171017
// Option 2: create your custom mastersRole with scoped assumeBy arn as the Cluster prop. Switch to this role from the AWS console.
1018-
import { KubectlV28Layer } from '@aws-cdk/lambda-layer-kubectl-v28';
1018+
import { KubectlV29Layer } from '@aws-cdk/lambda-layer-kubectl-v29';
10191019
declare const vpc: ec2.Vpc;
10201020

10211021
const mastersRole = new iam.Role(this, 'MastersRole', {
@@ -1024,8 +1024,8 @@ const mastersRole = new iam.Role(this, 'MastersRole', {
10241024

10251025
const cluster = new eks.Cluster(this, 'EksCluster', {
10261026
vpc,
1027-
version: eks.KubernetesVersion.V1_28,
1028-
kubectlLayer: new KubectlV28Layer(this, 'KubectlLayer'),
1027+
version: eks.KubernetesVersion.V1_29,
1028+
kubectlLayer: new KubectlV29Layer(this, 'KubectlLayer'),
10291029
mastersRole,
10301030
});
10311031

@@ -1309,7 +1309,7 @@ when a cluster is defined:
13091309

13101310
```ts
13111311
new eks.Cluster(this, 'MyCluster', {
1312-
version: eks.KubernetesVersion.V1_28,
1312+
version: eks.KubernetesVersion.V1_29,
13131313
prune: false,
13141314
});
13151315
```
@@ -1696,7 +1696,7 @@ property. For example:
16961696
```ts
16971697
const cluster = new eks.Cluster(this, 'Cluster', {
16981698
// ...
1699-
version: eks.KubernetesVersion.V1_28,
1699+
version: eks.KubernetesVersion.V1_29,
17001700
clusterLogging: [
17011701
eks.ClusterLoggingTypes.API,
17021702
eks.ClusterLoggingTypes.AUTHENTICATOR,

packages/aws-cdk-lib/aws-eks/lib/cluster.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,15 @@ export class KubernetesVersion {
934934
*/
935935
public static readonly V1_28 = KubernetesVersion.of('1.28');
936936

937+
/**
938+
* Kubernetes version 1.29
939+
*
940+
* When creating a `Cluster` with this version, you need to also specify the
941+
* `kubectlLayer` property with a `KubectlV29Layer` from
942+
* `@aws-cdk/lambda-layer-kubectl-v29`.
943+
*/
944+
public static readonly V1_29 = KubernetesVersion.of('1.29');
945+
937946
/**
938947
* Custom cluster version
939948
* @param version custom version number

packages/aws-cdk-lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@
498498
},
499499
"jsiiRosetta": {
500500
"exampleDependencies": {
501-
"@aws-cdk/lambda-layer-kubectl-v28": "^2.0.0",
501+
"@aws-cdk/lambda-layer-kubectl-v29": "^2.0.0",
502502
"cdk8s-plus-25": "^2.7.0",
503503
"@aws-cdk/aws-kinesisfirehose-alpha": "*",
504504
"@aws-cdk/aws-kinesisfirehose-destinations-alpha": "*"

0 commit comments

Comments
 (0)