Settings

Theme

Show HN: "Kubectl-split", to split multi-YAML into individual files

github.com

4 points by pdappollonio 4 years ago · 6 comments

Reader

WalterGR 4 years ago

This is done by parsing the YAML code and giving you the option to access any key from the YAML object using Go Templates.

Go Templates, for the curious:

https://pkg.go.dev/text/template

  • pdappollonioOP 4 years ago

    I'll take it as a call to action to link it from the docs. Thanks for checking it out!

    • WalterGR 4 years ago

      Way too many “Show HNs” don’t explain what the project is or why it’s useful or suggested uses, how to download, how to build, supported platforms, dependencies. There must be a checklist somewhere…

      If you want people to be interested or care, you have to imagine that you are them - they don’t know all the things you know.

      (This is not about your project. I just wanted to get that off my chest. ;)

      • pdappollonioOP 4 years ago

        Totally appreciate the feedback though! Since I knew something like this might come to show up, I decided to put the "why I created this tool" in the README as well.

tuananh 4 years ago

is there a mode to split based on referencing to each other? eg: i declare a secret and mount it as volume in deployment => put them to a same file?

  • pdappollonioOP 4 years ago

    If you can code that into a Go template, then absolutely. It does seem however that this would require knowledge of the dependencies of resources.

    For Kubernetes' own resources it might be easy to code. For CRDs, that's a whole other world.

    One solution: annotate both the deployment and the secret, then use the name template to export them into the same file or, in other words, split based on annotations. Hope that helps!

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection