terraform-cdk icon indicating copy to clipboard operation
terraform-cdk copied to clipboard

Typed Kubernetes Custom Resource Generator

Open konnta0 opened this issue 1 year ago • 3 comments

Description

I think CDKTF is a great and versatile tool! Here are some suggestions to further improve the development experience For k8s Provider, could you consider adding a tool like Pulumi's crd2pulumi to generate structures with types for each programming language from Custom Resource's yaml?

CRD is quite a lot of work to add by hand, so we thought that a tool that can generate boilerplate code might improve the development experience.

If possible, we would be very grateful if you would consider this!

I am new to CDKTF and have no knowledge of it, so if you already have a tool with similar functionality, I would appreciate it if you could point me in the right direction.

References

No response

Help Wanted

  • [ ] I'm interested in contributing a fix myself

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

konnta0 avatar Aug 13 '24 15:08 konnta0

@konnta0 you should take a look at https://cdk8s.io, specifically the cdk8s import which will create a class definition for your CRD, and the Include method, which will create an ApiObject from an existing yaml manifest.

Another option is https://github.com/smallcase/kube2cdk8s which uses Pulumi and cdk8s to template manifests.

zmully avatar Aug 16 '24 16:08 zmully

@zmully Thank you for your reply, I will try to get the cdk8s command to work for me. The cdk8s command is indeed a useful tool, but currently it did not seem to support development in .NET (C#). I want to develop in C#, so cdk8s doesn't seem to work for me under the current circumstances... Also, kube2cdk8s only supported TypeScript...

I will consider contributing to https://github.com/cdk8s-team/cdk8s-cli

If you know of any .NET (C#) that could meet our requirements, I would be very happy if you could share it with us!

konnta0 avatar Aug 20 '24 15:08 konnta0

I haven't tired it myself, but you could take a look at https://github.com/learnk8s/templating-kubernetes/blob/master/csharp/README.md

jsteinich avatar Aug 31 '24 02:08 jsteinich