Skip to content

Commit e72c87b

Browse files
committed
feat(eks-v2-alpha): support eks with k8s 1.33
1 parent 1b6e962 commit e72c87b

File tree

82 files changed

+481
-325
lines changed

Some content is hidden

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

82 files changed

+481
-325
lines changed

packages/@aws-cdk/aws-eks-v2-alpha/README.md

Lines changed: 40 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Here is the minimal example of defining an AWS EKS cluster
3333

3434
```ts
3535
const cluster = new eks.Cluster(this, 'hello-eks', {
36-
version: eks.KubernetesVersion.V1_32,
36+
version: eks.KubernetesVersion.V1_33,
3737
});
3838
```
3939

@@ -73,15 +73,15 @@ Creating a new cluster is done using the `Cluster` constructs. The only required
7373

7474
```ts
7575
new eks.Cluster(this, 'HelloEKS', {
76-
version: eks.KubernetesVersion.V1_32,
76+
version: eks.KubernetesVersion.V1_33,
7777
});
7878
```
7979

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

8282
```ts
8383
new eks.FargateCluster(this, 'HelloEKS', {
84-
version: eks.KubernetesVersion.V1_32,
84+
version: eks.KubernetesVersion.V1_33,
8585
});
8686
```
8787

@@ -90,12 +90,12 @@ be created by default. It will only be deployed when `kubectlProviderOptions`
9090
property is used.**
9191

9292
```ts
93-
import { KubectlV32Layer } from '@aws-cdk/lambda-layer-kubectl-v32';
93+
import { KubectlV33Layer } from '@aws-cdk/lambda-layer-kubectl-v33';
9494

9595
new eks.Cluster(this, 'hello-eks', {
96-
version: eks.KubernetesVersion.V1_32,
96+
version: eks.KubernetesVersion.V1_33,
9797
kubectlProviderOptions: {
98-
kubectlLayer: new KubectlV32Layer(this, 'kubectl'),
98+
kubectlLayer: new KubectlV33Layer(this, 'kubectl'),
9999
}
100100
});
101101
```
@@ -113,7 +113,7 @@ Auto Mode is enabled by default when creating a new cluster without specifying a
113113
```ts
114114
// Create EKS cluster with Auto Mode implicitly enabled
115115
const cluster = new eks.Cluster(this, 'EksAutoCluster', {
116-
version: eks.KubernetesVersion.V1_32,
116+
version: eks.KubernetesVersion.V1_33,
117117
});
118118
```
119119

@@ -122,7 +122,7 @@ You can also explicitly enable Auto Mode using `defaultCapacityType`:
122122
```ts
123123
// Create EKS cluster with Auto Mode explicitly enabled
124124
const cluster = new eks.Cluster(this, 'EksAutoCluster', {
125-
version: eks.KubernetesVersion.V1_32,
125+
version: eks.KubernetesVersion.V1_33,
126126
defaultCapacityType: eks.DefaultCapacityType.AUTOMODE,
127127
});
128128
```
@@ -138,7 +138,7 @@ These node pools are managed automatically by EKS. You can configure which node
138138

139139
```ts
140140
const cluster = new eks.Cluster(this, 'EksAutoCluster', {
141-
version: eks.KubernetesVersion.V1_32,
141+
version: eks.KubernetesVersion.V1_33,
142142
defaultCapacityType: eks.DefaultCapacityType.AUTOMODE,
143143
compute: {
144144
nodePools: ['system', 'general-purpose'],
@@ -154,7 +154,7 @@ You can disable the default node pools entirely by setting an empty array for `n
154154

155155
```ts
156156
const cluster = new eks.Cluster(this, 'EksAutoCluster', {
157-
version: eks.KubernetesVersion.V1_32,
157+
version: eks.KubernetesVersion.V1_33,
158158
defaultCapacityType: eks.DefaultCapacityType.AUTOMODE,
159159
compute: {
160160
nodePools: [], // Disable default node pools
@@ -171,7 +171,7 @@ If you prefer to manage your own node groups instead of using Auto Mode, you can
171171
```ts
172172
// Create EKS cluster with traditional managed node group
173173
const cluster = new eks.Cluster(this, 'EksCluster', {
174-
version: eks.KubernetesVersion.V1_32,
174+
version: eks.KubernetesVersion.V1_33,
175175
defaultCapacityType: eks.DefaultCapacityType.NODEGROUP,
176176
defaultCapacity: 3, // Number of instances
177177
defaultCapacityInstance: ec2.InstanceType.of(ec2.InstanceClass.T3, ec2.InstanceSize.LARGE),
@@ -182,7 +182,7 @@ You can also create a cluster with no initial capacity and add node groups later
182182

183183
```ts
184184
const cluster = new eks.Cluster(this, 'EksCluster', {
185-
version: eks.KubernetesVersion.V1_32,
185+
version: eks.KubernetesVersion.V1_33,
186186
defaultCapacityType: eks.DefaultCapacityType.NODEGROUP,
187187
defaultCapacity: 0,
188188
});
@@ -203,7 +203,7 @@ You can combine Auto Mode with traditional node groups for specific workload req
203203

204204
```ts
205205
const cluster = new eks.Cluster(this, 'Cluster', {
206-
version: eks.KubernetesVersion.V1_32,
206+
version: eks.KubernetesVersion.V1_33,
207207
defaultCapacityType: eks.DefaultCapacityType.AUTOMODE,
208208
compute: {
209209
nodePools: ['system', 'general-purpose'],
@@ -243,7 +243,7 @@ By default, when using `DefaultCapacityType.NODEGROUP`, this library will alloca
243243

244244
```ts
245245
new eks.Cluster(this, 'HelloEKS', {
246-
version: eks.KubernetesVersion.V1_32,
246+
version: eks.KubernetesVersion.V1_33,
247247
defaultCapacityType: eks.DefaultCapacityType.NODEGROUP,
248248
});
249249
```
@@ -252,7 +252,7 @@ At cluster instantiation time, you can customize the number of instances and the
252252

253253
```ts
254254
new eks.Cluster(this, 'HelloEKS', {
255-
version: eks.KubernetesVersion.V1_32,
255+
version: eks.KubernetesVersion.V1_33,
256256
defaultCapacityType: eks.DefaultCapacityType.NODEGROUP,
257257
defaultCapacity: 5,
258258
defaultCapacityInstance: ec2.InstanceType.of(ec2.InstanceClass.M5, ec2.InstanceSize.SMALL),
@@ -265,7 +265,7 @@ Additional customizations are available post instantiation. To apply them, set t
265265

266266
```ts
267267
const cluster = new eks.Cluster(this, 'HelloEKS', {
268-
version: eks.KubernetesVersion.V1_32,
268+
version: eks.KubernetesVersion.V1_33,
269269
defaultCapacityType: eks.DefaultCapacityType.NODEGROUP,
270270
defaultCapacity: 0,
271271
});
@@ -316,7 +316,7 @@ The following code defines an Amazon EKS cluster with a default Fargate Profile
316316

317317
```ts
318318
const cluster = new eks.FargateCluster(this, 'MyCluster', {
319-
version: eks.KubernetesVersion.V1_32,
319+
version: eks.KubernetesVersion.V1_33,
320320
});
321321
```
322322

@@ -335,7 +335,7 @@ You can configure the [cluster endpoint access](https://docs.aws.amazon.com/eks/
335335

336336
```ts
337337
const cluster = new eks.Cluster(this, 'hello-eks', {
338-
version: eks.KubernetesVersion.V1_32,
338+
version: eks.KubernetesVersion.V1_33,
339339
endpointAccess: eks.EndpointAccess.PRIVATE, // No access outside of your VPC.
340340
});
341341
```
@@ -357,7 +357,7 @@ To deploy the controller on your EKS cluster, configure the `albController` prop
357357

358358
```ts
359359
new eks.Cluster(this, 'HelloEKS', {
360-
version: eks.KubernetesVersion.V1_32,
360+
version: eks.KubernetesVersion.V1_33,
361361
albController: {
362362
version: eks.AlbControllerVersion.V2_8_2,
363363
},
@@ -398,7 +398,7 @@ You can specify the VPC of the cluster using the `vpc` and `vpcSubnets` properti
398398
declare const vpc: ec2.Vpc;
399399

400400
new eks.Cluster(this, 'HelloEKS', {
401-
version: eks.KubernetesVersion.V1_32,
401+
version: eks.KubernetesVersion.V1_33,
402402
vpc,
403403
vpcSubnets: [{ subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS }],
404404
});
@@ -441,12 +441,12 @@ To create a `Kubectl Handler`, use `kubectlProviderOptions` when creating the cl
441441
`kubectlLayer` is the only required property in `kubectlProviderOptions`.
442442

443443
```ts
444-
import { KubectlV32Layer } from '@aws-cdk/lambda-layer-kubectl-v32';
444+
import { KubectlV33Layer } from '@aws-cdk/lambda-layer-kubectl-v33';
445445

446446
new eks.Cluster(this, 'hello-eks', {
447-
version: eks.KubernetesVersion.V1_32,
447+
version: eks.KubernetesVersion.V1_33,
448448
kubectlProviderOptions: {
449-
kubectlLayer: new KubectlV32Layer(this, 'kubectl'),
449+
kubectlLayer: new KubectlV33Layer(this, 'kubectl'),
450450
}
451451
});
452452
```
@@ -456,8 +456,6 @@ new eks.Cluster(this, 'hello-eks', {
456456
If you want to use an existing kubectl provider function, for example with tight trusted entities on your IAM Roles - you can import the existing provider and then use the imported provider when importing the cluster:
457457

458458
```ts
459-
import { KubectlV32Layer } from '@aws-cdk/lambda-layer-kubectl-v32';
460-
461459
const handlerRole = iam.Role.fromRoleArn(this, 'HandlerRole', 'arn:aws:iam::123456789012:role/lambda-role');
462460
// get the serivceToken from the custom resource provider
463461
const functionArn = lambda.Function.fromFunctionName(this, 'ProviderOnEventFunc', 'ProviderframeworkonEvent-XXX').functionArn;
@@ -477,12 +475,12 @@ const cluster = eks.Cluster.fromClusterAttributes(this, 'Cluster', {
477475
You can configure the environment of this function by specifying it at cluster instantiation. For example, this can be useful in order to configure an http proxy:
478476

479477
```ts
480-
import { KubectlV32Layer } from '@aws-cdk/lambda-layer-kubectl-v32';
478+
import { KubectlV33Layer } from '@aws-cdk/lambda-layer-kubectl-v33';
481479

482480
const cluster = new eks.Cluster(this, 'hello-eks', {
483-
version: eks.KubernetesVersion.V1_32,
481+
version: eks.KubernetesVersion.V1_33,
484482
kubectlProviderOptions: {
485-
kubectlLayer: new KubectlV32Layer(this, 'kubectl'),
483+
kubectlLayer: new KubectlV33Layer(this, 'kubectl'),
486484
environment: {
487485
'http_proxy': 'http://proxy.myproxy.com',
488486
},
@@ -503,12 +501,12 @@ Depending on which version of kubernetes you're targeting, you will need to use
503501
the `@aws-cdk/lambda-layer-kubectl-vXY` packages.
504502

505503
```ts
506-
import { KubectlV32Layer } from '@aws-cdk/lambda-layer-kubectl-v32';
504+
import { KubectlV33Layer } from '@aws-cdk/lambda-layer-kubectl-v33';
507505

508506
const cluster = new eks.Cluster(this, 'hello-eks', {
509-
version: eks.KubernetesVersion.V1_32,
507+
version: eks.KubernetesVersion.V1_33,
510508
kubectlProviderOptions: {
511-
kubectlLayer: new KubectlV32Layer(this, 'kubectl'),
509+
kubectlLayer: new KubectlV33Layer(this, 'kubectl'),
512510
},
513511
});
514512
```
@@ -518,14 +516,14 @@ const cluster = new eks.Cluster(this, 'hello-eks', {
518516
By default, the kubectl provider is configured with 1024MiB of memory. You can use the `memory` option to specify the memory size for the AWS Lambda function:
519517

520518
```ts
521-
import { KubectlV32Layer } from '@aws-cdk/lambda-layer-kubectl-v32';
519+
import { KubectlV33Layer } from '@aws-cdk/lambda-layer-kubectl-v33';
522520

523521
new eks.Cluster(this, 'MyCluster', {
524522
kubectlProviderOptions: {
525-
kubectlLayer: new KubectlV32Layer(this, 'kubectl'),
523+
kubectlLayer: new KubectlV33Layer(this, 'kubectl'),
526524
memory: Size.gibibytes(4),
527525
},
528-
version: eks.KubernetesVersion.V1_32,
526+
version: eks.KubernetesVersion.V1_33,
529527
});
530528
```
531529

@@ -556,7 +554,7 @@ When you create a cluster, you can specify a `mastersRole`. The `Cluster` constr
556554
```ts
557555
declare const role: iam.Role;
558556
new eks.Cluster(this, 'HelloEKS', {
559-
version: eks.KubernetesVersion.V1_32,
557+
version: eks.KubernetesVersion.V1_33,
560558
mastersRole: role,
561559
});
562560
```
@@ -577,7 +575,7 @@ You can use the `secretsEncryptionKey` to configure which key the cluster will u
577575
const secretsKey = new kms.Key(this, 'SecretsKey');
578576
const cluster = new eks.Cluster(this, 'MyCluster', {
579577
secretsEncryptionKey: secretsKey,
580-
version: eks.KubernetesVersion.V1_32,
578+
version: eks.KubernetesVersion.V1_33,
581579
});
582580
```
583581

@@ -587,7 +585,7 @@ You can also use a similar configuration for running a cluster built using the F
587585
const secretsKey = new kms.Key(this, 'SecretsKey');
588586
const cluster = new eks.FargateCluster(this, 'MyFargateCluster', {
589587
secretsEncryptionKey: secretsKey,
590-
version: eks.KubernetesVersion.V1_32,
588+
version: eks.KubernetesVersion.V1_33,
591589
});
592590
```
593591

@@ -628,7 +626,7 @@ eks.AccessPolicy.fromAccessPolicyName('AmazonEKSAdminPolicy', {
628626
Use `grantAccess()` to grant the AccessPolicy to an IAM principal:
629627

630628
```ts
631-
import { KubectlV32Layer } from '@aws-cdk/lambda-layer-kubectl-v32';
629+
import { KubectlV33Layer } from '@aws-cdk/lambda-layer-kubectl-v33';
632630
declare const vpc: ec2.Vpc;
633631

634632
const clusterAdminRole = new iam.Role(this, 'ClusterAdminRole', {
@@ -642,9 +640,9 @@ const eksAdminRole = new iam.Role(this, 'EKSAdminRole', {
642640
const cluster = new eks.Cluster(this, 'Cluster', {
643641
vpc,
644642
mastersRole: clusterAdminRole,
645-
version: eks.KubernetesVersion.V1_32,
643+
version: eks.KubernetesVersion.V1_33,
646644
kubectlProviderOptions: {
647-
kubectlLayer: new KubectlV32Layer(this, 'kubectl'),
645+
kubectlLayer: new KubectlV33Layer(this, 'kubectl'),
648646
memory: Size.gibibytes(4),
649647
},
650648
});
@@ -829,7 +827,7 @@ when a cluster is defined:
829827

830828
```ts
831829
new eks.Cluster(this, 'MyCluster', {
832-
version: eks.KubernetesVersion.V1_32,
830+
version: eks.KubernetesVersion.V1_33,
833831
prune: false,
834832
});
835833
```
@@ -1145,7 +1143,7 @@ property. For example:
11451143
```ts
11461144
const cluster = new eks.Cluster(this, 'Cluster', {
11471145
// ...
1148-
version: eks.KubernetesVersion.V1_32,
1146+
version: eks.KubernetesVersion.V1_33,
11491147
clusterLogging: [
11501148
eks.ClusterLoggingTypes.API,
11511149
eks.ClusterLoggingTypes.AUTHENTICATOR,

packages/@aws-cdk/aws-eks-v2-alpha/lib/cluster.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,15 @@ export class KubernetesVersion {
676676
*/
677677
public static readonly V1_32 = KubernetesVersion.of('1.32');
678678

679+
/**
680+
* Kubernetes version 1.33
681+
*
682+
* When creating a `Cluster` with this version, you need to also specify the
683+
* `kubectlLayer` property with a `KubectlV33Layer` from
684+
* `@aws-cdk/lambda-layer-kubectl-v33`.
685+
*/
686+
public static readonly V1_33 = KubernetesVersion.of('1.33');
687+
679688
/**
680689
* Custom cluster version
681690
* @param version custom version number

packages/@aws-cdk/aws-eks-v2-alpha/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
"@aws-cdk/lambda-layer-kubectl-v30": "^2.0.4",
9393
"@aws-cdk/lambda-layer-kubectl-v31": "^2.1.0",
9494
"@aws-cdk/lambda-layer-kubectl-v32": "^2.1.0",
95+
"@aws-cdk/lambda-layer-kubectl-v33": "^2.0.0",
9596
"@types/jest": "^29.5.14",
9697
"aws-sdk": "^2.1692.0",
9798
"aws-cdk-lib": "0.0.0",
@@ -134,8 +135,7 @@
134135
},
135136
"jsiiRosetta": {
136137
"exampleDependencies": {
137-
"@aws-cdk/lambda-layer-kubectl-v31": "^2.0.0",
138-
"@aws-cdk/lambda-layer-kubectl-v32": "^2.0.0",
138+
"@aws-cdk/lambda-layer-kubectl-v33": "^2.0.0",
139139
"cdk8s-plus-25": "^2.7.0"
140140
}
141141
}

packages/@aws-cdk/aws-eks-v2-alpha/test/automode.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import * as iam from 'aws-cdk-lib/aws-iam';
44
import * as eks from '../lib';
55
import { testFixtureNoVpc } from './util';
66

7-
const CLUSTER_VERSION = eks.KubernetesVersion.V1_32;
7+
const CLUSTER_VERSION = eks.KubernetesVersion.V1_33;
88

99
describe('eks auto mode', () => {
1010
describe('basic configuration', () => {

0 commit comments

Comments
 (0)