Kubesplit¶
Kubesplit splits a multidoc YAML file of Kubernetes descriptors into a set of single-resource files, one file per resource, nicely formatted and organized by namespace.
It reads YAML from a file or STDIN and writes one file per resource into an output directory:
all-in-one.yml ──► kubesplit ──► output-dir/
├── 00--namespace--apps-demo.yml
├── 01--clusterrole--example-node-viewer.yml
└── ingress-controllers/
├── 20--deployment--traefik-ingress-controller.yml
└── 30--service--traefik-web-ui.yml
Why?¶
- Because a single
kustomize buildorhelm templateproduces a giant multidoc stream that is hard to read and review. - Because storing one resource per file — named after its kind and name, grouped by namespace — makes diffs, code reviews and GitOps repositories much easier to navigate.
- Because the generated files should be consistently formatted:
kubesplitreuses yamkix under the hood so every file follows the same opinionated YAML style.
If you just want an opinionated YAML formatter (without the Kubernetes splitting), have a look at yamkix directly.
Documentation¶
The documentation follows the Diátaxis framework:
- Tutorials — start here if you are new: install kubesplit and split your first manifest.
- How-to guides — task-oriented recipes: install, split descriptors, organize the output, control quotes, tune the YAML formatting, use with Kustomize and Helm.
- Reference — information-oriented descriptions: CLI options, file naming and layout, public API, changelog.
- Explanation — understanding-oriented background: how kubesplit works, ecosystem.