Giter VIP home page Giter VIP logo

kube-split-yaml's Introduction

Kube Split Yaml

Simple tool to split one file with kubernetes manifests into separated ones.

Use cases

Useful when you are using kustomize and you want to evaluate generated manifests after kustomize build . with OPA.

$ kustomize build <path_to_kustomization> >> build.yaml
$ kube-split-yaml split --input build.yaml --output-dir manifests
$ for i in $(ls manifests); do opa eval -d <validation_rego> -i manifests/$i data.kubernetes.admission.deny --format=pretty; done

Installation and usage

  1. Install
    $ go get -v github.com/borisputerka/kube-split-yaml
    
  2. Use plugin
    $ kube-split-yaml split --input <input_file> --output-dir <output_dir>
    

Flags reference

By default kube-split-yaml splits each kubernetes resource from input file into separated file in format:

{{.kind}}-{{.apiVersion}}-{{.metadata.namespace}}-{{.metadata.name}}.yaml

Here are flags that can be used with split command:

Flag Description Default
input Input file to split. Can be replaced with stdin ""
output-dir Output directory where divided yamls will be written split_yaml
group-by-kind Group manifests based on their kind (in format <.kind>.yaml) false

kube-split-yaml's People

Contributors

borisputerka avatar borisputerka-zz avatar lirt avatar

Stargazers

 avatar

Watchers

 avatar

kube-split-yaml's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.