Split multidoc yaml formatted kubernetes descriptors to a set of single resource files.
10K+
Split multidoc yaml formatted kubernetes descriptors to a set of single resource files.
If you just want an opinionated yaml formatter, you can have a look at yamkix.
# Use latest
docker image pull looztra/kubesplit
# Or one of the version+sha1 related tags
docker image pull looztra/kubesplit:[version]-[sha1]
# Enjoy
docker container run \
-i --rm \
-v $(pwd):/code \
-w /code looztra/kubesplit \
-i path/to/yaml_file.yml \
-o path/to/output/directory
# or
cat path/to/yaml_file.yml | \
docker container run \
-i --rm \
-v $(pwd):/code \
-w /code looztra/kubesplit \
-o path/to/output/directory
Note : do NOT specify the -t/--ttyflag when using the second invocation style to avoid the error message the input device is not a TTY
╰(.venv)─» kubesplit -h
usage: kubesplit [-h] [-i INPUT] [-t TYP] -o OUTPUT_DIR [-n] [-e] [-q] [-f]
[-d] [-c] [-p]
Split a set of Kubernetes descriptors to a set of files. The yaml format of
the generated files can be tuned using the same parameters as the one used by
Yamkix. By default, explicit_start is `On`, explicit_end is `Off` and array
elements are pushed inwards the start of the matching sequence. Comments are
preserved thanks to default parsing mode `rt`.
optional arguments:
-h, --help show this help message and exit
-i INPUT, --input INPUT
the file to parse, or STDIN if not specified or if
value is -
-t TYP, --typ TYP the yaml parser mode. Can be `safe` or `rt`
-o OUTPUT_DIR, --output-dir OUTPUT_DIR
the name of the output target directory. The target
directory will be created if it does not exist if it's
possible
-n, --no-explicit-start
by default, explicit start (---) of the yaml doc is
`On`, you can disable it with this option
-e, --explicit-end by default, explicit end (...) of the yaml doc is
`Off`, you can enable it with this option
-q, --no-quotes-preserved
by default, quotes are preserved you can disable this
with this option
-f, --default-flow-style
enable the default flow style `Off` by default. In
default flow style (with typ=`rt`), maps and lists are
written like json
-d, --no-dash-inwards
by default, dash are pushed inwards use `--no-dash-
inwards` to have the dash start at the sequence level
-c, --clean-output-dir
clean the output directory (rmtree) if set (default is
False)
-p, --no-resource-prefix
by default, resource files are number prefixed, you
can disable this behaviour with this flag
--no-resource-prefix to disable order prefixes--no-quotes-preserved to disable quotes unless needed (for boolean and numbers if they were provided in the input as for the moment Kubesplit is not aware of the fact that only kubernetes annotations and environment variables require string)-d/--no-dash-inwards optionkubesplit) the output directory with the -c/--clean-output-dir (use at your own risks)Content type
Image
Digest
Size
29.2 MB
Last updated
about 6 years ago
docker pull looztra/kubesplit