Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(eks): support for Kubernetes version 1.23 #22638

Merged
merged 54 commits into from
Oct 27, 2022
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
c93ed9d
fix(eks): kubectl layer must contain AWS CLI
rix0rrr Oct 19, 2022
d1e4a58
Tests
rix0rrr Oct 19, 2022
d184727
Update packages/@aws-cdk/aws-eks/lib/cluster.ts
rix0rrr Oct 19, 2022
3e985be
Snapshots some more
rix0rrr Oct 19, 2022
4c1b57b
Merge branch 'huijbers/eks-separate-awscli-layer' of github.com:aws/a…
rix0rrr Oct 19, 2022
0696a37
Tests
rix0rrr Oct 19, 2022
f1a484a
Snapshots some more
rix0rrr Oct 19, 2022
9892f6a
Update cluster.ts
rix0rrr Oct 20, 2022
e821907
Merge branch 'main' into huijbers/eks-separate-awscli-layer
madeline-k Oct 21, 2022
a0b1d71
feat(eks): support for Kubernetes version 1.22
madeline-k Oct 21, 2022
6ebd1b6
Remove residual integration test files
madeline-k Oct 21, 2022
4e8c7ee
update README and version number
madeline-k Oct 21, 2022
888db08
update readme
madeline-k Oct 21, 2022
b782726
integration tests
madeline-k Oct 25, 2022
7bf6b0d
Merge branch 'main' into madeline-k/kubernetes-v22
madeline-k Oct 25, 2022
11bf39e
feat(eks): support for Kubernetes version 1.23
kaizencc Oct 25, 2022
9f9db94
minor version
kaizencc Oct 25, 2022
67da92b
add latest aws-cdk-lib to devDependencies so it can be used in integr…
madeline-k Oct 25, 2022
cdf5d1d
revert
kaizencc Oct 25, 2022
9d89f1a
Merge branch 'madeline-k/kubernetes-v22' into conroy/kubernetes-v23
kaizencc Oct 25, 2022
bfa8d82
kubectlv23
kaizencc Oct 25, 2022
098af04
Merge branch 'main' into conroy/kubernetes-v23
kaizencc Oct 25, 2022
39fc1ac
revert
kaizencc Oct 25, 2022
b98823f
eks bottlerocket integ snapshot update
kaizencc Oct 25, 2022
9bc19f5
Merge branch 'conroy/kubernetes-v23' of https://github.com/aws/aws-cd…
kaizencc Oct 25, 2022
87dd8dc
unit tests for annotations
kaizencc Oct 25, 2022
9e7169b
update integ tests: integ.eks-helm-asset, integ.eks-cluster-private-e…
madeline-k Oct 26, 2022
6d07cc1
integ tests: integ.fargate-cluster.js, integ.eks-cluster-handlers-vpc.js
madeline-k Oct 26, 2022
083d849
update alb-controller integ test to use cdk8s-plus-23
madeline-k Oct 26, 2022
5360272
fix(eks): kubectl get handler output includes stderr
kaizencc Oct 26, 2022
615e271
Merge branch 'conroy/eks' into conroy/kubernetes-v23
madeline-k Oct 26, 2022
1279bde
re-run integ tests: integ.fargate-cluster, integ.eks-helm-asset, inte…
madeline-k Oct 26, 2022
9b9dec7
alb controller test
kaizencc Oct 26, 2022
1a654de
integ tests: integ.alb-controller, integ.eks-cluster-private-endpoint…
madeline-k Oct 26, 2022
68e8d60
eks cluster private endpoint snapshot
kaizencc Oct 27, 2022
f55ca4a
eks cluster snapshot
kaizencc Oct 27, 2022
bb1819c
eks inference snapshot
kaizencc Oct 27, 2022
bc9b3fc
more tests
madeline-k Oct 27, 2022
5b12477
cleanup integ snapshots
madeline-k Oct 27, 2022
fc3764e
update yarn.lock
madeline-k Oct 27, 2022
9c02969
integ tests: integ.eks-helm-asset integ.eks-bottlerocket-ng
madeline-k Oct 27, 2022
6d961b5
fargate cluster snapshot
kaizencc Oct 27, 2022
cb1b11e
yarn.lock file
kaizencc Oct 27, 2022
cc477ce
Merge branch 'conroy/eks' of https://github.com/aws/aws-cdk into conr…
kaizencc Oct 27, 2022
c3461ba
cluster handlers vpc snapshot
kaizencc Oct 27, 2022
10d85ba
alb controller
kaizencc Oct 27, 2022
b9622a9
Merge branch 'main' into conroy/eks
kaizencc Oct 27, 2022
fbf9939
stepfunctions-tasks snapshot updates
kaizencc Oct 27, 2022
930212d
Merge branch 'conroy/eks' of https://github.com/aws/aws-cdk into conr…
kaizencc Oct 27, 2022
af3362c
Merge branch 'main' into conroy/eks
kaizencc Oct 27, 2022
84c7e9e
Merge branch 'conroy/eks' into conroy/kubernetes-v23
madeline-k Oct 27, 2022
cba6fe2
merge conflicts
madeline-k Oct 27, 2022
6dc385e
Merge branch 'main' into conroy/kubernetes-v23
madeline-k Oct 27, 2022
97281d2
use semver
madeline-k Oct 27, 2022
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
20 changes: 15 additions & 5 deletions packages/@aws-cdk/aws-eks/lib/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,15 @@ export class KubernetesVersion {
*/
public static readonly V1_22 = KubernetesVersion.of('1.22');

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

/**
* Custom cluster version
* @param version custom version number
Expand Down Expand Up @@ -1372,8 +1381,9 @@ export class Cluster extends ClusterBase {
this.prune = props.prune ?? true;
this.vpc = props.vpc || new ec2.Vpc(this, 'DefaultVpc');

if (props.version === KubernetesVersion.V1_22 && !props.kubectlLayer) {
Annotations.of(this).addWarning(`You created a cluster with Kubernetes Version ${props.version} without specifying the kubectlLayer property. This may cause failures as the kubectl version provided with aws-cdk-lib is 1.20, which is only guaranteed to be compatible with Kubernetes versions 1.19-1.21. Please provide a kubectlLayer from @aws-cdk/lambda-layer-kubectl-v22.`);
const kubectlVersion = Number(props.version.version) * 100;
madeline-k marked this conversation as resolved.
Show resolved Hide resolved
if (kubectlVersion >= 122 && !props.kubectlLayer) {
Annotations.of(this).addWarning(`You created a cluster with Kubernetes Version ${props.version} without specifying the kubectlLayer property. This may cause failures as the kubectl version provided with aws-cdk-lib is 1.20, which is only guaranteed to be compatible with Kubernetes versions 1.19-1.21. Please provide a kubectlLayer from @aws-cdk/lambda-layer-kubectl-v${kubectlVersion % 100}.`);
kaizencc marked this conversation as resolved.
Show resolved Hide resolved
};
this.version = props.version;
this.kubectlLambdaRole = props.kubectlLambdaRole ? props.kubectlLambdaRole : undefined;
Expand Down Expand Up @@ -2300,7 +2310,7 @@ export enum CoreDnsComputeType {
/**
* Deploy CoreDNS on Fargate-managed instances.
*/
FARGATE = 'fargate'
FARGATE = 'fargate',
kaizencc marked this conversation as resolved.
Show resolved Hide resolved
}

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

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

function nodeTypeForInstanceType(instanceType: ec2.InstanceType) {
Expand Down
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-eks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@aws-cdk/lambda-layer-kubectl-v22": "2.0.0",
"@aws-cdk/lambda-layer-kubectl-v22": "^2.0.0",
"@aws-cdk/lambda-layer-kubectl-v23": "^2.0.0",
kaizencc marked this conversation as resolved.
Show resolved Hide resolved
"aws-cdk-lib": "^2.47.0",
"@aws-cdk/assertions": "0.0.0",
"@aws-cdk/cdk-build-tools": "0.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import * as lambda from '@aws-cdk/aws-lambda';
import { KubectlV22Layer } from '@aws-cdk/lambda-layer-kubectl-v22';
import { KubectlV23Layer } from '@aws-cdk/lambda-layer-kubectl-v23';
import { Construct } from 'constructs';
import * as eks from '../lib';

export function getClusterVersionConfig(scope: Construct) {
return {
version: eks.KubernetesVersion.V1_22,
version: eks.KubernetesVersion.V1_23,
// Crazy type-casting is required because KubectlLayer peer depends on
// types from aws-cdk-lib, but we run integration tests in the @aws-cdk/
// v1-style directory, not in the aws-cdk-lib v2-style directory.
kubectlLayer: new KubectlV22Layer(scope, 'KubectlLayer') as unknown as lambda.ILayerVersion,
kubectlLayer: new KubectlV23Layer(scope, 'KubectlLayer') as unknown as lambda.ILayerVersion,
};
};
7 changes: 6 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,16 @@
"@jridgewell/gen-mapping" "^0.1.0"
"@jridgewell/trace-mapping" "^0.3.9"

"@aws-cdk/lambda-layer-kubectl-v22@2.0.0":
"@aws-cdk/lambda-layer-kubectl-v22@^2.0.0":
version "2.0.0"
resolved "https://registry.npmjs.org/@aws-cdk/lambda-layer-kubectl-v22/-/lambda-layer-kubectl-v22-2.0.0.tgz#18daadbb856a42377c04ea81b029debc1523ad3a"
integrity sha512-GdpZbfry6jJ+NGOxYNrmTm0TNU3xjhjROgIiy9fdFZzb6PaKBglLftBAJbyNldPbvWfl2G+PJWe2jBURUkeacw==

"@aws-cdk/lambda-layer-kubectl-v23@^2.0.0":
version "2.0.0"
resolved "https://registry.npmjs.org/@aws-cdk/lambda-layer-kubectl-v23/-/lambda-layer-kubectl-v23-2.0.0.tgz#8e46c505c8ba106d7589c9bebda824b8d963463c"
integrity sha512-g0H20+aWk6p4NsLSnMwUCwuLbD9v1tLPYH8c229w/qT6B7U/DFliQmiSnGSxe7BOjL/qfIkLfvXReBji15yEvg==

"@babel/code-frame@7.12.11":
version "7.12.11"
resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f"
Expand Down