Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 40 additions & 42 deletions packages/@aws-cdk/aws-eks-v2-alpha/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Here is the minimal example of defining an AWS EKS cluster

```ts
const cluster = new eks.Cluster(this, 'hello-eks', {
version: eks.KubernetesVersion.V1_32,
version: eks.KubernetesVersion.V1_33,
});
```

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

```ts
new eks.Cluster(this, 'HelloEKS', {
version: eks.KubernetesVersion.V1_32,
version: eks.KubernetesVersion.V1_33,
});
```

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

```ts
new eks.FargateCluster(this, 'HelloEKS', {
version: eks.KubernetesVersion.V1_32,
version: eks.KubernetesVersion.V1_33,
});
```

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

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

new eks.Cluster(this, 'hello-eks', {
version: eks.KubernetesVersion.V1_32,
version: eks.KubernetesVersion.V1_33,
kubectlProviderOptions: {
kubectlLayer: new KubectlV32Layer(this, 'kubectl'),
kubectlLayer: new KubectlV33Layer(this, 'kubectl'),
}
});
```
Expand All @@ -113,7 +113,7 @@ Auto Mode is enabled by default when creating a new cluster without specifying a
```ts
// Create EKS cluster with Auto Mode implicitly enabled
const cluster = new eks.Cluster(this, 'EksAutoCluster', {
version: eks.KubernetesVersion.V1_32,
version: eks.KubernetesVersion.V1_33,
});
```

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

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

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

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

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

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

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

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

```ts
const cluster = new eks.FargateCluster(this, 'MyCluster', {
version: eks.KubernetesVersion.V1_32,
version: eks.KubernetesVersion.V1_33,
});
```

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

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

```ts
new eks.Cluster(this, 'HelloEKS', {
version: eks.KubernetesVersion.V1_32,
version: eks.KubernetesVersion.V1_33,
albController: {
version: eks.AlbControllerVersion.V2_8_2,
},
Expand Down Expand Up @@ -398,7 +398,7 @@ You can specify the VPC of the cluster using the `vpc` and `vpcSubnets` properti
declare const vpc: ec2.Vpc;

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

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

new eks.Cluster(this, 'hello-eks', {
version: eks.KubernetesVersion.V1_32,
version: eks.KubernetesVersion.V1_33,
kubectlProviderOptions: {
kubectlLayer: new KubectlV32Layer(this, 'kubectl'),
kubectlLayer: new KubectlV33Layer(this, 'kubectl'),
}
});
```
Expand All @@ -456,8 +456,6 @@ new eks.Cluster(this, 'hello-eks', {
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:

```ts
import { KubectlV32Layer } from '@aws-cdk/lambda-layer-kubectl-v32';

const handlerRole = iam.Role.fromRoleArn(this, 'HandlerRole', 'arn:aws:iam::123456789012:role/lambda-role');
// get the serivceToken from the custom resource provider
const functionArn = lambda.Function.fromFunctionName(this, 'ProviderOnEventFunc', 'ProviderframeworkonEvent-XXX').functionArn;
Expand All @@ -477,12 +475,12 @@ const cluster = eks.Cluster.fromClusterAttributes(this, 'Cluster', {
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:

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

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

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

const cluster = new eks.Cluster(this, 'hello-eks', {
version: eks.KubernetesVersion.V1_32,
version: eks.KubernetesVersion.V1_33,
kubectlProviderOptions: {
kubectlLayer: new KubectlV32Layer(this, 'kubectl'),
kubectlLayer: new KubectlV33Layer(this, 'kubectl'),
},
});
```
Expand All @@ -518,14 +516,14 @@ const cluster = new eks.Cluster(this, 'hello-eks', {
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:

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

new eks.Cluster(this, 'MyCluster', {
kubectlProviderOptions: {
kubectlLayer: new KubectlV32Layer(this, 'kubectl'),
kubectlLayer: new KubectlV33Layer(this, 'kubectl'),
memory: Size.gibibytes(4),
},
version: eks.KubernetesVersion.V1_32,
version: eks.KubernetesVersion.V1_33,
});
```

Expand Down Expand Up @@ -556,7 +554,7 @@ When you create a cluster, you can specify a `mastersRole`. The `Cluster` constr
```ts
declare const role: iam.Role;
new eks.Cluster(this, 'HelloEKS', {
version: eks.KubernetesVersion.V1_32,
version: eks.KubernetesVersion.V1_33,
mastersRole: role,
});
```
Expand All @@ -577,7 +575,7 @@ You can use the `secretsEncryptionKey` to configure which key the cluster will u
const secretsKey = new kms.Key(this, 'SecretsKey');
const cluster = new eks.Cluster(this, 'MyCluster', {
secretsEncryptionKey: secretsKey,
version: eks.KubernetesVersion.V1_32,
version: eks.KubernetesVersion.V1_33,
});
```

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

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

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

const clusterAdminRole = new iam.Role(this, 'ClusterAdminRole', {
Expand All @@ -642,9 +640,9 @@ const eksAdminRole = new iam.Role(this, 'EKSAdminRole', {
const cluster = new eks.Cluster(this, 'Cluster', {
vpc,
mastersRole: clusterAdminRole,
version: eks.KubernetesVersion.V1_32,
version: eks.KubernetesVersion.V1_33,
kubectlProviderOptions: {
kubectlLayer: new KubectlV32Layer(this, 'kubectl'),
kubectlLayer: new KubectlV33Layer(this, 'kubectl'),
memory: Size.gibibytes(4),
},
});
Expand Down Expand Up @@ -829,7 +827,7 @@ when a cluster is defined:

```ts
new eks.Cluster(this, 'MyCluster', {
version: eks.KubernetesVersion.V1_32,
version: eks.KubernetesVersion.V1_33,
prune: false,
});
```
Expand Down Expand Up @@ -1145,7 +1143,7 @@ property. For example:
```ts
const cluster = new eks.Cluster(this, 'Cluster', {
// ...
version: eks.KubernetesVersion.V1_32,
version: eks.KubernetesVersion.V1_33,
clusterLogging: [
eks.ClusterLoggingTypes.API,
eks.ClusterLoggingTypes.AUTHENTICATOR,
Expand Down
9 changes: 9 additions & 0 deletions packages/@aws-cdk/aws-eks-v2-alpha/lib/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,15 @@ export class KubernetesVersion {
*/
public static readonly V1_32 = KubernetesVersion.of('1.32');

/**
* Kubernetes version 1.33
*
* When creating a `Cluster` with this version, you need to also specify the
* `kubectlLayer` property with a `KubectlV33Layer` from
* `@aws-cdk/lambda-layer-kubectl-v33`.
*/
public static readonly V1_33 = KubernetesVersion.of('1.33');

/**
* Custom cluster version
* @param version custom version number
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-eks-v2-alpha/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
"@aws-cdk/lambda-layer-kubectl-v30": "^2.0.4",
"@aws-cdk/lambda-layer-kubectl-v31": "^2.1.0",
"@aws-cdk/lambda-layer-kubectl-v32": "^2.1.0",
"@aws-cdk/lambda-layer-kubectl-v33": "^2.0.0",
"@types/jest": "^29.5.14",
"aws-sdk": "^2.1692.0",
"aws-cdk-lib": "0.0.0",
Expand Down Expand Up @@ -134,8 +135,7 @@
},
"jsiiRosetta": {
"exampleDependencies": {
"@aws-cdk/lambda-layer-kubectl-v31": "^2.0.0",
"@aws-cdk/lambda-layer-kubectl-v32": "^2.0.0",
"@aws-cdk/lambda-layer-kubectl-v33": "^2.0.0",
"cdk8s-plus-25": "^2.7.0"
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-eks-v2-alpha/test/automode.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as iam from 'aws-cdk-lib/aws-iam';
import * as eks from '../lib';
import { testFixtureNoVpc } from './util';

const CLUSTER_VERSION = eks.KubernetesVersion.V1_32;
const CLUSTER_VERSION = eks.KubernetesVersion.V1_33;

describe('eks auto mode', () => {
describe('basic configuration', () => {
Expand Down
Loading
Loading