Code Monkey home page Code Monkey logo

yshard's Introduction

yshard

Huge yaml files are impossible to understand, so let's split them up!

yshard is a CLI that takes a single YAML file as input and splits it into separate files, doing a GROUP BY on the user-provided JSON path. It is particularly useful in cases where large complex packages are distributed as a single YAML file, containing multiple YAML documents - as is often the case for Kubernetes manifests. yshard is also useful when you render your own templates into a single output file.

Getting Started

Grab the binary for your architecture from the releases page

Get a YAML file you want to split up, for example:

wget https://raw.githubusercontent.com/argoproj/argo-workflows/stable/manifests/install.yaml

Now use yshard to split the YAML, in this case we split by the kind field of each document, putting documents with the same kind in the same file in output-directory:

cat install | yshard -g ".kind" -o output-directory

Then in the output directory you see:

$ ls output-directory
ClusterRole.yml              ConfigMap.yml                Deployment.yml               RoleBinding.yml              ServiceAccount.yml
ClusterRoleBinding.yml       CustomResourceDefinition.yml Role.yml                     Service.yml                  __ungrouped__.yml

yshard's People

Contributors

benjvi avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

yshard'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.