cdk8s-team / cdk8s

Define Kubernetes native apps and abstractions using object-oriented programming
https://cdk8s.io
Apache License 2.0
4.29k stars 290 forks source link

Use language specific package managers to distribute re-usable libraries #262

Closed rothgar closed 4 years ago

rothgar commented 4 years ago

Description of the feature or enhancement:

Currently if I want to use cdk8s+ in python I need to install cdk8s-cli via npm. That doesn't make sense with other libraries and tools devs use. We should distribute our language specific libraries via their respective package managers (eg pip) and document how other developers can distribute their own libraries publicly and privately.

Use Case:

To make sharing and re-using libraries easier and more natural in the language the developer wants to write. It also makes building, testing, and developing more natural for devs because they don't need to learn a new tool or organization (e.g. kustomize) and instead can rely on things like package.json and requirements.txt

Proposed Solution:

Similar to https://pypi.org/project/cdk8s-debore/ we should distribute cdk8s-plus directly via npm, pip, and whatever other language we provide it in.


This is a :rocket: Feature Request

iliapolo commented 4 years ago

Hi @rothgar

Currently if I want to use cdk8s+ in python I need to install cdk8s-cli via npm

Actually, cdk8s+ is already distributed to PyPI: https://pypi.org/project/cdk8s-plus/.

Have a look at an example usage

Is this what you meant?

The CLI is only needed if you want to dynamically generate code using the cdk8s import command, but to use the constructs in cdk8s+, you don't need it.

rothgar commented 4 years ago

Wow thanks! I don't know how I missed that. Is there documentation recommending how users create and distribute their own libraries? We can probably just link to how cdk8s and cdk8s-plus already do it.

I think I'll look at the examples more and maybe create a PR for an example without using cdk8s binary. A pure python or pure node example probably would have helped me understand when and where cdk8s is required.

iliapolo commented 4 years ago

@rothgar So actually cdk8s is just a regular jsii package, and you can have a look here on how to set it up: Publishing Modules.

cdk8s-plus is a little different in that in also vends the auto-generated L1 constructs that were imported (once) using the cdk8s-cli. I agree we should have proper documentation on how to do that though.

I will close this issue in favor of one that says we need instructions on how to vend cdk8s based libraries, sound good?

rothgar commented 4 years ago

Yes, excellent. Thank you

iliapolo commented 4 years ago

Closing in favor of https://github.com/awslabs/cdk8s/issues/263