Coder Social home page Coder Social logo

playmtl / crd-to-sample-yaml Goto Github PK

View Code? Open in Web Editor NEW

This project forked from skarlso/crd-to-sample-yaml

0.0 0.0 0.0 1.04 MB

Generate a sample YAML file from a CRD

Home Page: https://crds.cronohub.org

License: Apache License 2.0

Go 16.26% CSS 74.64% Makefile 1.48% HTML 7.38% Dockerfile 0.25%

crd-to-sample-yaml's Introduction

crd-to-sample-yaml or cty ( city )

Generate a sample YAML file from a CRD definition.

Getting started

  • Prerequisites: Go installed on your machine. (Check out this link for details: https://go.dev/doc/install)
  • Clone the repository
  • Execute make build to build the binary

Now you can simply run:

cty generate -c delivery.krok.app_krokcommands

Optionally, define a URL at which a CRD is located:

cty generate -u https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-aws/main/config/crd/bases/infrastructure.cluster.x-k8s.io_awsclusters.yaml

cty does not support authentication modes, therefore the CRD needs to be publicly accessible.

This will result in a file similar to this:

apiVersion: delivery.krok.app/v1alpha1
kind: KrokCommand
metadata: {}
spec:
  commandHasOutputToWrite: true
  dependencies: ["string"]
  enabled: true
  image: string
  platforms: ["string"]
  readInputFromSecret:
    name: string
    namespace: string
  schedule: string
status: {}

A single file will be created containing all versions in the CRD delimited by ---.

Optionally, you can provide the flag -s which will output the generated content to stdout.

Future plans include generating proper, schema validated values for all fields.

There is also an option to run this as a server. Run:

cty serve

This will start a front-end that can be used to paste in and parse CRDs.

Showcase

frontpage

parsed1 parsed2

crd-to-sample-yaml's People

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.