fkorotkov / k8s-kotlin-dsl

Kotlin DSL for Kubernetes configs
MIT License
339 stars 19 forks source link

Migration tool from yaml #34

Open rrva opened 2 years ago

rrva commented 2 years ago

Is there any migration tool that will help me go from yaml to kotlin dsl?

fkorotkov commented 2 years ago

Unfortunately there is none at the moment. Do you use any processor in order to generate your YAML or you have just a vanilla YAML written by hand?

One idea I had is to make a serialization tool which you can point to an object in your Kubernetes cluster and it will generate a DSL for that.

rrva commented 2 years ago

It have hand-written yaml for the most part. Also some helm based things but these have tools to convert to raw kubernetes yaml.

I also had the idea to connect to the cluster, get the objects and then serialize it to kotlin. That would work fine I think...

Where to start?

rrva commented 2 years ago

https://square.github.io/kotlinpoet/ comes to mind as a possible ingredient