krisnova / naml

Convert Kubernetes YAML to Golang
Apache License 2.0
1.26k stars 37 forks source link

TGIK: spotlight on naml #77

Closed Piotr1215 closed 3 years ago

Piotr1215 commented 3 years ago

Just wanted to say that I really like the project, writing (or templating) YAML is just painful!

Also if anyone is interested, TGIK will be doing an episode showcasing naml on their Youtube channel in 2 days, it will be fun to watch :)

https://youtu.be/ubJ4n_QHs98

krisnova commented 3 years ago

Hey thanks @Piotr1215!

I will be working on a really quality sample application for TGIK specifically for us to go through.

I will keep this thread updated with links and pointers as I find them if anyone wants to bookmark this thread.

krisnova commented 3 years ago

I put together the naml-examples/tgik repository.

It basically is just the Kubernetes dashboard that was translated to a single project using naml codify.

I made minimal changes from the output, and figured we can write a unit test or something tomorrow,

Piotr1215 commented 3 years ago

Great! I've just tested the tgik demo on v1.21.3 (1 master, 2 workers) with calico CNI. It installs pretty fast and also uninstalls cleanly as far as I can tell. Pipe to naml codify works also on other test pods from the sample project.

If I pipe yaml to naml codify in a fresh folder. I get main.go correctly and run go mod init, go mod tidy, go mod vendor. After this running go run main.go gives an error: vendor/github.com/kris-nova/naml/codify/codify.go:38:20: undefined: valast.ASTWithPackages

I'm not sure if I'm not doing something wrong here.

Btw, the problem when KUBECONFIG variable points to more than one config file still persist. I had to squash 2 configs into one file to make it work (issue #35)

krisnova commented 3 years ago

To address the go run main.go error please see https://github.com/kris-nova/naml/issues/76 until #62 and related are merged into the tree

krisnova commented 3 years ago

ill take a look at #35 again - if you have clear replication instructions i could happily try to code in a solution - if you are interested in coding it in yourself please do

Piotr1215 commented 3 years ago

I'll give it a try :)