Skip to content
This repository was archived by the owner on Aug 15, 2023. It is now read-only.

Split Kubernetes YAML output into one file per resource

License

Notifications You must be signed in to change notification settings

nathforge/kubectl-split-yaml

Repository files navigation

kubectl-split-yaml

A kubectl plugin to split Kubernetes YAML output into one file per resource.

Example

$ 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

Usage

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

Installation

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.

Recommended projects

  • ketall: like kubectl get all, but gets everything.
  • kubectl-neat: removes clutter from Kubernetes resources; metadata, status, etc.

License

Apache 2.0. See LICENSE.

About

Split Kubernetes YAML output into one file per resource

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages