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

Conversation

kaizencc
Copy link
Contributor

@kaizencc kaizencc commented Oct 25, 2022

Add support for Kubernetes Version 1.23. In order to use this version, customers must pass in a KubectlLayer object from @aws-cdk/lambda-layer-kubectl-v23 to the kubectlLayer construct prop of Cluster.


All Submissions:

Adding new Unconventional Dependencies:

  • This PR adds new unconventional dependencies following the process described here

New Features

  • Have you added the new feature to an integration test?
    • Did you use yarn integ to deploy the infrastructure and generate the snapshot (i.e. yarn integ without --dry-run)?

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

rix0rrr and others added 16 commits October 19, 2022 15:40
The EKS Cluster construct has a property called `kubectlLayer`. When this
property was not given, it would add a two default layers to the custom
resource:

- One with kubectl
- One with the AWS CLI

However, if the property was given, the one layer must contain both
kubectl as well as the AWS CLI.

This makes the `kubectl` layer unnecessarily large -- it must also
contain the AWS CLI which the CDK already has and can bundle itself.

Add a separate `awscliLayer` parameter to control the AWS CLI layer,
if the user so wants. If not, the default AWS CLI layer will be added.

If some user is already using a `kubectlLayer` which includes the AWS
CLI, we now add both the default AWS CLI layer as well as the user's
kubectl layer with the AWS CLI in it. There is no conflict: multiple
layers can contain the same files.  Last layer wins (which is the
kubectl layer with the user's preferred AWS CLI).
Co-authored-by: Eli Polonsky <epolon@amazon.com>
…ws-cdk into huijbers/eks-separate-awscli-layer
@gitpod-io
Copy link

gitpod-io bot commented Oct 25, 2022

@github-actions github-actions bot added the p2 label Oct 25, 2022
@kaizencc kaizencc changed the title Conroy/kubernetes v23 feat(eks): support for Kubernetes version 1.23 Oct 25, 2022
@aws-cdk-automation aws-cdk-automation requested a review from a team October 25, 2022 19:28
@kaizencc kaizencc changed the base branch from main to madeline-k/kubernetes-v22 October 25, 2022 19:28
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Oct 25, 2022
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

@TheRealAmazonKendra
Copy link
Contributor

PR Linter has words for you.

@kaizencc kaizencc added the pr-linter/exempt-readme The PR linter will not require README changes label Oct 27, 2022
@kaizencc
Copy link
Contributor Author

readme exempt; this is a feature for a new version and the method to include new kubectl versions is already included in the readme.

@aws-cdk-automation aws-cdk-automation dismissed their stale review October 27, 2022 14:06

✅ Updated pull request passes all PRLinter validations. Dissmissing previous PRLinter review.

Base automatically changed from conroy/eks to main October 27, 2022 16:40
@robertd
Copy link
Contributor

robertd commented Oct 27, 2022

@pahud We need MVP awards/recognition for each release. I nominate @madeline-k & @kaizencc for the upcoming v2.48.0 release 😃 🎉 🚀

Copy link
Contributor

@madeline-k madeline-k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me and has my approval! I am not going to officially approve, as I am now a significant co-author, and I'd like someone else in the team to approve.

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;
if (kubectlVersion >= 122 && !props.kubectlLayer) {
Annotations.of(this).addWarning(`You created a cluster with Kubernetes Version ${props.version.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}.`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it that it may cause errors or that it will? If we know it will, I think this should be an error.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If not, no issues here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not for certain. In some cases you can use a version of kubectl that is not guaranteed to be compatible with the version of the Kubernetes engine you are using. It just depends on the APIs being used.

"data": "KubectlLayer600207B5"
"data": "KubectlLayer600207B5",
"trace": [
"!!DESTRUCTIVE_CHANGES: WILL_REPLACE"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a concern?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, a lambda layer is a stateless resource, and we are replacing it with an upgraded version of kubectl. So, the replacement is expected here.

Copy link
Contributor

@MrArnoldPalmer MrArnoldPalmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a small suggestion

packages/@aws-cdk/aws-eks/lib/cluster.ts Outdated Show resolved Hide resolved
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 97281d2
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify
Copy link
Contributor

mergify bot commented Oct 27, 2022

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 4e858f2 into main Oct 27, 2022
@mergify mergify bot deleted the conroy/kubernetes-v23 branch October 27, 2022 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS. p2 pr-linter/exempt-readme The PR linter will not require README changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants