kptdev / kpt

Automate Kubernetes Configuration Editing
https://kpt.dev
Apache License 2.0
1.7k stars 227 forks source link

kpt vs cdk8s/pulumi #2818

Open phanimarupaka opened 2 years ago

phanimarupaka commented 2 years ago

What are the advantages of kpt(Config as Data) over cdk8s/pulumi way of managing applications?

Advantages of cdk8s/pulumi:

  1. More appealing to developers. Defining infra as code in their language of choice is an immediate buy.
  2. Packaging is taken care by the language and is already familiar to developers. As opposed to versioned kpt packages, developers can use versioned library abstractions in their language of choice.
  3. Developers can use advanced language constructs to generate/validate/modify YAML.
  4. Code can be unit tested. In kpt, a developer needs to add kpt functions to test/validate YAML which is abit tedious.

Disadvantages of cdk8s/pulumi:

  1. Shifts source of truth to code instead of YAML(data). YAML becomes a mere intermediate layer and shouldn't be edited directly.
  2. It is impossible to automatically back port changes made to YAML. Similarly it is not possible to onboard existing YAML to code automatically.
  3. Abstractions should be built in multiple languages based on the demand from developers.
  4. Interoperability of tools on the YAML(e.g. Cloud Code) can't be achieved as YAML can't be modified by other tools.
  5. Makes infra edits restricted to developers and only through code.

Please suggest more @droot @mikebz @bgrant0607

bgrant0607 commented 2 years ago

Does pulumi work with any GitOps tools other than the pulumi service? I assume that cdk8s could be integrated into ArgoCD via the plugin mechanism -- looks like an issue has been filed.

Interestingly, pulumi just announced yaml support: https://www.pulumi.com/blog/pulumi-yaml/. I don't know if their sdk supports manipulating it, though.

I just updated a bunch of docs to describe the CaD approach. Generation only is pretty limiting. Someone could use only generator functions in kpt. Probably cdk8s could even be adapted for that. But that's a subset of what kpt can do and would give up the benefits of WYSIWYG configuration, composable transformations written in different languages, interoperable automation, etc.

https://kpt.dev/book/02-concepts/ https://kpt.dev/guides/rationale https://kpt.dev/faq/

guettli commented 1 year ago

Somehow cdk8s is more popular:

image

What could be the reason for this?