Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 5 additions & 2 deletions packages/@aws-cdk/aws-eks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,11 @@ The kubectl handler uses `kubectl`, `helm` and the `aws` CLI in order to
interact with the cluster. These are bundled into AWS Lambda layers included in
the `@aws-cdk/lambda-layer-awscli` and `@aws-cdk/lambda-layer-kubectl` modules.

The version of kubectl used must be compatible wtih the Kubernetes version of the cluster. kubectl is supported within one minor version (older or newer) of Kubernetes (see [Kubernetes version skew policy](https://kubernetes.io/releases/version-skew-policy/#kubectl)). Only version 1.20 of kubectl is available in `aws-cdk-lib`. If you need a different version, you will need to use one of the `@aws-cdk/lambda-layer-kubectlvXY` packages.
The version of kubectl used must be compatible with the Kubernetes version of the
cluster. kubectl is supported within one minor version (older or newer) of Kubernetes
(see [Kubernetes version skew policy](https://kubernetes.io/releases/version-skew-policy/#kubectl)).
Only version 1.20 of kubectl is available in `aws-cdk-lib`. If you need a different
version, you will need to use one of the `@aws-cdk/lambda-layer-kubectlvXY` packages.

```ts
import { KubectlV22Layer } from '@aws-cdk/lambda-layer-kubectl-v22';
Expand All @@ -685,7 +689,6 @@ const cluster = new eks.Cluster(this, 'hello-eks', {
version: eks.KubernetesVersion.V1_22,
kubectlLayer: new KubectlV22Layer(this, 'kubectl'),
});

```

You can also specify a custom `lambda.LayerVersion` if you wish to use a
Expand Down
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-eks/lib/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2300,7 +2300,7 @@ export enum CoreDnsComputeType {
/**
* Deploy CoreDNS on Fargate-managed instances.
*/
FARGATE = 'fargate'
FARGATE = 'fargate',
}

/**
Expand All @@ -2314,7 +2314,7 @@ export enum DefaultCapacityType {
/**
* EC2 autoscaling group
*/
EC2
EC2,
}

/**
Expand All @@ -2328,7 +2328,7 @@ export enum MachineImageType {
/**
* Bottlerocket AMI
*/
BOTTLEROCKET
BOTTLEROCKET,
}

function nodeTypeForInstanceType(instanceType: ec2.InstanceType) {
Expand Down
6 changes: 0 additions & 6 deletions packages/@aws-cdk/aws-eks/test/alb-controller.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { Cluster, KubernetesVersion, AlbController, AlbControllerVersion, HelmCh
import { testFixture } from './util';

test('all vended policies are valid', () => {

const addOnsDir = path.join(__dirname, '..', 'lib', 'addons');

for (const addOn of fs.readdirSync(addOnsDir)) {
Expand All @@ -23,11 +22,9 @@ test('all vended policies are valid', () => {
}
}
}

});

test('can configure a custom repository', () => {

const { stack } = testFixture();

const cluster = new Cluster(stack, 'Cluster', {
Expand Down Expand Up @@ -58,11 +55,9 @@ test('can configure a custom repository', () => {
],
},
});

});

test('throws when a policy is not defined for a custom version', () => {

const { stack } = testFixture();

const cluster = new Cluster(stack, 'Cluster', {
Expand All @@ -73,5 +68,4 @@ test('throws when a policy is not defined for a custom version', () => {
cluster,
version: AlbControllerVersion.of('custom'),
})).toThrowError("'albControllerOptions.policy' is required when using a custom controller version");

});
15 changes: 1 addition & 14 deletions packages/@aws-cdk/aws-eks/test/awsauth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ import { testFixtureNoVpc } from './util';
const CLUSTER_VERSION = KubernetesVersion.V1_16;

describe('aws auth', () => {

test('throws when adding a role from a different stack', () => {

const app = new cdk.App();
const clusterStack = new cdk.Stack(app, 'ClusterStack');
const roleStack = new cdk.Stack(app, 'RoleStack');
Expand All @@ -26,12 +24,9 @@ describe('aws auth', () => {
}).toThrow(
'RoleStack/Role should be defined in the scope of the ClusterStack stack to prevent circular dependencies',
);


});

test('throws when adding a user from a different stack', () => {

const app = new cdk.App();
const clusterStack = new cdk.Stack(app, 'ClusterStack');
const userStack = new cdk.Stack(app, 'UserStack');
Expand All @@ -45,8 +40,6 @@ describe('aws auth', () => {
}).toThrow(
'UserStack/User should be defined in the scope of the ClusterStack stack to prevent circular dependencies',
);


});

test('empty aws-auth', () => {
Expand All @@ -66,7 +59,6 @@ describe('aws auth', () => {
data: { mapRoles: '[]', mapUsers: '[]', mapAccounts: '[]' },
}]),
});

});

test('addRoleMapping and addUserMapping can be used to define the aws-auth ConfigMap', () => {
Expand Down Expand Up @@ -159,8 +151,6 @@ describe('aws auth', () => {
],
},
});


});

test('imported users and roles can be also be used', () => {
Expand Down Expand Up @@ -222,9 +212,8 @@ describe('aws auth', () => {
],
},
});


});

test('addMastersRole after addNodegroup correctly', () => {
// GIVEN
const { stack } = testFixtureNoVpc();
Expand Down Expand Up @@ -283,7 +272,5 @@ describe('aws auth', () => {
],
},
});


});
});
Loading