Open Vad1mo opened 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
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.
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
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.
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):
any
. In general the framework doesn't really seem to adhere to modern TypeScript best practices and uses a lot of any
types internally and on the API surface. Concretely when you do a const deployment = new KubeDeployment(this, "my-deployment", { spec: ... } )
you can't reference any of the spec properties of the deployment in a typed way. This makes reusing / referencing sub properties between k8s resources pretty brittle. Also cdk8s seemed to generate some resource names with random numbers and ck8s specific labels that are used for service selection etc. . Lastly since it solely relies on classes/constructors, it's not directly possible to define resources async, which limits what you can do. Altogether cdk8s just feels a bit too heavy and magic. I just want something that feels like a lightweight node library to generate arbitrary configuration, rather than some magic k8s-specific wrapper thing.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.
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!
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.