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

Ship self-contained binary #1764

Open AndreasBergmeier6176 opened 8 months ago

AndreasBergmeier6176 commented 8 months ago

Description of the feature or enhancement:

Setting up Node with all the necessities and keeping it running is quite some complexity for non-Javascript developers. There should be a self-contained distribution of cdk8s which minimizes this complexity.

Use Case:

We are currently searching for replacements for Helm. cdk seems very near to how we would like to render Manifests from Python. We are however not willing to introduce the mental load of Node into our Development process. Thus we are currently passing on using cdk8s.

Proposed Solution:

From a containment perspective I wonder whether Rust + Deno would be a good way to go. A less intrusive way could be shipping via Node - https://nodejs.org/api/single-executable-applications.html - but not sure whether this would work here. Alternatively it might work to package using AppImage?


This is a :rocket: Feature Request

shinebayar-g commented 7 months ago

how we would like to render Manifests from Python.

Wdym? Using Python doesn't require Node.

AndreasBergmeier6176 commented 7 months ago

Sorry, we were initially under the impression that cdk8s could be used to render manifests to filesystem. Seems like this is not possible. The general problem still persists, though - you need a correct Node environment to be able to run cdk8s. Thus shipping a self-contained binary would eliminate the need to setup and maintain local dependencies.

shinebayar-g commented 7 months ago

you need a correct Node environment to be able to run cdk8s.

Ah this might be true. IIRC https://github.com/cdk8s-team/cdk8s-cli doesn't even run on Deno. Only worked on NodeJS. CLI could be self portable for sure.

iliapolo commented 3 months ago

Semi related: https://github.com/cdk8s-team/cdk8s-cli/issues/1468.

The thing is that its not sufficient for the cli to be self-container because the framework itself also requires node via jsii. One way to do this is by having a docker image for cdk8s, and a docker image for node, and then aliasing cdk8s and node to docker run ....

Keeping up to date is now a matter of docker pull, instead of node management - but is that really that much easier? In any case, keeping this open to see how folks respond.

QuadmanSWE commented 3 months ago

Came across this while looking for a way to run cdk8s in a container so that it could be used as a plugin for argocd. Does nothing like this exist? What is the slimest possible image one could make that could render yaml from cdk8s code for one of the supported languages?

shinebayar-g commented 3 months ago

I guess something like

FROM node:alpine
RUN npm i -g cdk8s-cli

is a minimum starting point.

QuadmanSWE commented 3 months ago

Thanks. Got it to work.