kubernetes-split-yaml
Table of contents
Split a giant yaml file into one file per Kubernetes resource
This program can be useful in case it’s necessary to split a big Kubernetes yaml manifest files into small ones.
It supports filters using namespaced hierarchy, Kubernetes objects starting with a word or Deployments and StatefulSets types.
Information
Source | Tracker | VCS | QA | Bugs
- Version: 0.4.0-1
- Architecture: any
- Standards-Version: 4.6.2
- Maintainer: Debian Kubernetes Packaging Team (DMD)
Releases
- 0.3.0-1 (bookworm )
- 0.4.0-1 (sid | unstable )
If you are using an unlisted debian version probably that means this package it’s not available.
Installation
apt install kubernetes-split-yaml
Completion
Completions will be installed for bash
, zsh
and fish
shells.
Usage
Simple invocation
kubernetes-split-yaml giant-k8s-file.yaml
Modify / filter output filenames
# Note by default it'll output 0.2.0 non-hierical files
$ kubernetes-split-yaml --help
# Get namespaced hierarchy for output files
$ kubernetes-split-yaml --template_sel tpl_ns --outdir my-clustername/namespaces giant-k8s-file.yaml
# Ditto above, but only for Kubernetes objects starting with "myapp"
$ kubernetes-split-yaml --name_re ^myapp --template_sel tpl_ns --outdir my-clustername/namespaces giant-k8s-file.yaml
# Ditto above, but only for Deployments and StatefulSets
$ kubernetes-split-yaml --kind_re '^(StatefulSet|Deployment)' --name_re ^myapp --template_sel tpl_ns --outdir my-clustername/namespaces giant-k8s-file.yaml