https://github.com/jnewland/yamsplode
🍠 💥 | Explodes multi-document Kubernetes YAML files into multiple files
https://github.com/jnewland/yamsplode
kubernetes yaml
Last synced: 2 months ago
JSON representation
🍠 💥 | Explodes multi-document Kubernetes YAML files into multiple files
- Host: GitHub
- URL: https://github.com/jnewland/yamsplode
- Owner: jnewland
- License: mit
- Created: 2018-01-03T17:54:49.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-02-12T19:53:47.000Z (over 7 years ago)
- Last Synced: 2026-03-29T17:26:28.982Z (3 months ago)
- Topics: kubernetes, yaml
- Language: Ruby
- Homepage:
- Size: 14.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# YAM(L)splode
Explodes multi-document Kubernetes YAML files into multiple files, each containing a single YAML document.
#### Motivation
For all sorts of valid reasons, folks seem to like distributing Kubernetes applications as one large file containing multiple YAML documents. I prefer to read (and sometimes edit) these sorts of files before blindly passing them to `kubectl`, and also generally prefer to store them in source control. Both of those things are way easier with a bunch of YAML files containing single documents rather than one large file. Thus, this tool.
# Usage
`yamsplode` is distributed as a Docker image that expects a single YAML file at `in.yaml`, and a directory at `/out`.
docker run --rm \
-v ~/Downloads/istio-0.4.0/install/kubernetes/istio-auth.yaml:/in.yaml \
-v ~/src/kubernetes-config/istio:/out \
jnewland/yamsplode
Writing /out/namespaces/istio-system.yaml ...
Writing /out/clusterroles/istio-pilot-istio-system.yaml ...
Writing /out/clusterroles/istio-initializer-istio-system.yaml ...
Writing /out/clusterroles/istio-mixer-istio-system.yaml ...
Writing /out/clusterroles/istio-ca-istio-system.yaml ...
Writing /out/clusterroles/istio-sidecar-istio-system.yaml ...
You can also use `-` as an argument to denote that input has been provided via STDIN:
helm template stable/openvpn | docker run --rm -i -v path/to/kustomize/base:/out jnewland/yamsplode -
Writing /out/configmaps/release-name-openvpn.yaml ...
Writing /out/persistentvolumeclaims/release-name-openvpn.yaml ...
Writing /out/services/release-name-openvpn.yaml ...
Writing /out/deployments/release-name-openvpn.yaml ..
That's it!