Just wanted to share some thoughts on working with...
# general
Just wanted to share some thoughts on working with Kubernetes CRDs in Pulumi, especially with Typescript. Currently, it's challenging to maintain type-safe coding with CRDs due to certain issues. The crd2pulumi CLI, while initially promising, has been somewhat inconsistent. For instance, I encountered issues when using it with the Pulumi Operator CRD. There's also a complexity around code generation, particularly with a monolithic repo setup. The CLI tends to produce an opinionated project with its own package.json, tsconfig, etc. which aren't aligned with my linting or tsconfig rules. Managing separate repositories for each CRD isn't ideal either. My preference leans toward vendored packages that can be updated easily. An article I found here discusses a potential solution in community-maintained SDKs. But this seems to have its drawbacks too, particularly around longevity and consistency. This is evident from a repository like this which hasn't been updated in a year. Given these concerns, I've been using ConfigFile to apply the raw yaml for CRDs in Pulumi. But this means missing out on some of Pulumi's core benefits - type safety and code completion, especially when dealing with custom resources, which comprise a significant chunk of my work. I'm curious about others' experiences with Kubernetes in Pulumi and Typescript. Also, any insights on how Pulumi plans to address these CRD issues would be appreciated.
I’ve had the same problems with configuring custom resources. I had some YAMLs to translate into pulumi (with TS), GitHub Copilot helped a bit. There were strange issues with some data types representation in the generated configurations, so I had to double-check everything when something wasn’t working as expected. But in general, it was quite reasonable to translate everything from YAML to pulumi as the configs became DRY.
according to opinionated TSconfig: I’ve found that it’s possible to disable the default TS (it uses too outdated TS version by default) in the root
Copy code
  name: nodejs
    typescript: false
Then compile your TS code as usual, and set the entrypoint for pulumi in
like this:
Copy code
"main": "dist/index.js",
@wooden-queen-36575 the mentioned project hasn't been updated in a while because we rely on
also. At the moment, there are a number of issues to be fixed first.