tommy351 / kosko

Organize Kubernetes manifests in TypeScript.
https://kosko.dev
MIT License
339 stars 11 forks source link

Why would one use Kosko instead of CDK8s? #102

Open Vad1mo opened 2 years ago

Vad1mo commented 2 years ago

Found the project and it looks interesting. I was wondering why would I want to use Kosko instead of CDK8s.

I didn't find any answer in the code or docs so hence the question/feature request to add this information.

revolunet commented 2 years ago

Hi, some input as a user :

Pros :

Cons, but i guess they're the same on CDK8S :

Try the playground to see for yourself : https://kosko.dev/play

Vad1mo commented 2 years ago

ArgoCD can be used with CDK8s as plain k8s manifests are rendered. This makes also the output usable by ops people and their tooling and workflows with k8s manifests.

revolunet commented 2 years ago

kosko also renders plain manifests at the end, but i meant argocd cannot execute kosko er cdk8s by itself, the manifests needs to be GIT versionned

tommy351 commented 2 years ago

Kosko is just a tool that renders TypeScript code into YAML and provides environment management, IDE auto-completion, and OpenAPI validation.

Based on what I saw on cdk8s documentation, it seems to be more focused on charts, dependency management, and multi-language support.

I think it might be easier to migrate to Kosko than cdk8s. If you have existing YAML files, you can load them directly, or let Kosko rewrite them into JavaScript for you. Kosko also supports Helm charts and Kustomize.

geekflyer commented 2 years ago

I just spend the past few days evaluating different solutions to use render k8s manifests (and potentially other stuff) using TypeScript+Node. From the TypeScript+Node camp I like kosko so far the most. Here's my personal comparison (will update as I discover more stuff):

My kosko impressions: It feels relatively lightweight, supports programmatic use. Relatively natural API that leverages ES exports/imports and normal way to define reuse methods whichever way you want (classes, functions (incl async), modules, up to you). Also one can see from the code that the author knows TypeScript well enough to avoid spurious use of any. First class support for creating resources in async functions. Altogether kosko looks much better than cdk8s to me, despite cdk8s popularity (well the AWS brand...).

Will update my thoughts as I use the product more.

RealityAnomaly commented 2 years ago

Wow this really seems like the holy grail. Have experimented with many solutions including Terraform, Pulumi, cdk8s and even my own custom-built nix-and-jsonnet nightmare amalgamation. Will report when I've evaluated more!