A kubectl
plugin to split Kubernetes YAML output into one file per resource.
$ kubectl get all -o yaml | kubectl split-yaml -p resources
resources/v1--Pod/default--nginx-86c57db685-4vnjc.yaml
resources/v1--Service/default--nginx.yaml
resources/apps_v1--Deployment/default--nginx.yaml
kubectl split-yaml [flags]
, where [flags]
can contain:
-f
: input file. If not given, or set to-
, standard input is used.-p
: output directory. Defaults to./split-yaml
.-t
: filename template: Defaults to{{.apiVersion}}--{{.kind}}/{{.namespace}}--{{.name}}.yaml
Recommended: Install Krew to manage kubectl
plugins then run kubectl krew update; kubectl krew install split-yaml
Otherwise, binaries are available from the releases page.
- ketall: like
kubectl get all
, but gets everything. - kubectl-neat: removes clutter from Kubernetes resources; metadata, status, etc.
Apache 2.0. See LICENSE.