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 cdk8s charts #10562

Merged
merged 42 commits into from
Oct 6, 2020
Merged

feat(eks): Support cdk8s charts #10562

merged 42 commits into from
Oct 6, 2020

Conversation

iliapolo
Copy link
Contributor

@iliapolo iliapolo commented Sep 27, 2020

Natively integrate EKS with the cdk8s library.

Closes #9670


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

@iliapolo iliapolo added the pr/do-not-merge This PR should not be merged at this time. label Sep 27, 2020
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Sep 27, 2020
@iliapolo iliapolo requested a review from eladb September 30, 2020 09:12
@iliapolo iliapolo marked this pull request as ready for review September 30, 2020 09:12
packages/@aws-cdk/aws-eks/README.md Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-eks/README.md Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-eks/README.md Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-eks/README.md Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-eks/lib/cluster.ts Show resolved Hide resolved
@iliapolo iliapolo assigned eladb and unassigned iliapolo Oct 3, 2020
@iliapolo iliapolo requested a review from eladb October 6, 2020 10:07
Copy link
Contributor

@eladb eladb left a comment

Choose a reason for hiding this comment

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

Added "do-not-merge"

packages/@aws-cdk/aws-eks/README.md Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-eks/README.md Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-eks/README.md Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-eks/README.md Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-eks/README.md Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-eks/README.md Show resolved Hide resolved
packages/@aws-cdk/aws-eks/README.md Outdated Show resolved Hide resolved
@iliapolo iliapolo removed the pr/do-not-merge This PR should not be merged at this time. label Oct 6, 2020
@mergify
Copy link
Contributor

mergify bot commented Oct 6, 2020

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

@mergify
Copy link
Contributor

mergify bot commented Oct 6, 2020

Thank you for contributing! Your pull request will be updated from master 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 e51921d into master Oct 6, 2020
@mergify mergify bot deleted the epolon/eks-cdk8s branch October 6, 2020 14:36
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 3b34b82
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

"fs-extra": "^9.0.1",
"pkglint": "0.0.0",
"ts-node": "^9.0.0",
"typescript": "~3.8.3",
"ubergen": "0.0.0"
},
"peerDependencies": {
"constructs": "^3.0.4"
"constructs": "^3.0.4",
"cdk8s": "^0.30.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

@iliapolo @eladb was this intentional? This means that users using monocdk will need to add to their dependencies: monocdk, constructs and cdk8s

Copy link
Contributor

Choose a reason for hiding this comment

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

That's a very good point. Technically they will only need this if they use this feature but that's not something we can express through regular peer deps. @iliapolo Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

Here's a trick that we might be able to use: I wonder if we should not advertise this as a peer dependency but rather just document that it's required in the closure.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean just for monocdk? Might require some build twicks because its omission is causing a build failure. We can try it though, agree it will be a better experience.

And in case it's not going to solve this quirk for v2 where that dependency will actually be needed to compile the code...I think for v2 thats just a hit we will have to take, one of the disadvantages of having a monolithic package.

Copy link
Contributor

Choose a reason for hiding this comment

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

I would try to list it as a buildDependency and exclude the eslint rule.

I don't think we can take the hit for monocdk. We need a solution for this type of "opt in peer". Npm has a concept of "optionalDependencies" which might be what we need

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll give it a try

Copy link
Contributor

Choose a reason for hiding this comment

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

“I do not like it, I do not like it at all; I do not like it as a peer dependency, I do not like it as dev dependency”

Copy link
Contributor

@NetaNir NetaNir Oct 15, 2020

Choose a reason for hiding this comment

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

Just to make sure we are all in agreement on the meaning of adding this as a peer-dependency (or any type of dependency which is requires the user to supply it). This means that the EKS module will always have to support the minimal version of cdk8s declared in monocdk, if not, it will be considered a breaking change for monocdk customers. Might be worth considering extracting the APIs to a separate package

Copy link
Contributor

Choose a reason for hiding this comment

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

It's a little late now but I 100 million % agree with Neta.

It can't be an optionalDependency: cdk8s.Chart must be downloaded and exist to even COMPILE this, and to typecheck the downstream .d.ts files.

The only feasible solution is to use IoC and an integration package:

aws-eks : IKubeDefinition
aws-eks-cdk8s: class Cdk8sDefinition implements IKubeDefinition

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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[aws-eks] Support adding cdk8s charts to the Cluster
7 participants