Skip to content

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

Comments

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?

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!

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.