Code Monkey home page Code Monkey logo

crds-catalog's Introduction

CRDs Catalog

This repository aggregates over 100 popular Kubernetes CRDs (CustomResourceDefinition) in JSON schema format. These schemas can be used by various tools such as Datree, Kubeconform and Kubeval, as an alternative to kubectl --dry-run, to perform validation on custom (and native) Kuberentes resources.

Running Kubernetes schema validation checks helps apply the "shift-left approach" on machines without giving them access to your cluster (e.g. locally or on CI).

How to use the schemas in the catalog

Datree

datree test [MANIFEST]

Kubeconform

kubeconform -schema-location default -schema-location 'https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/{{.Group}}/{{.ResourceKind}}_{{.ResourceAPIVersion}}.json' [MANIFEST]

kubeval

Only supported with the CRD Extractor

๐Ÿ‘‰ If you encounter custom resources that are not part of the catalog, or you want to validate the schemas in an air-gapped environment, use the CRD Extractor.


CRD Extractor

This repository also contains a handy utility that extracts all CRDs from a cluster and converts them to JSON schema.

What does this utility do?

  1. Checks that the prerequisites are installed.
  2. Extracts your CRDs from your cluster using kubectl.
  3. Downloads a script from the kubeconform repo that converts your CRDs from openAPI to JSON schema.
  4. Runs the script, and saves the output to your machine under $HOME/.datree/crdSchemas/

Supported Platforms

This utility supports MacOS and Linux.

Prerequisites

The following programs are required to be installed on the machine running this utility:

Usage

To use the CRD Extractor:

  1. Download the latest release from this repository.
  2. Extract, and run the utility:
./crd-extractor.sh

image


Shifting left CRD validation - Video by Datree


Contributing CRDs to the catalog

If the catalog is missing public custom resources (CRs) that you would like to automatically validate using these tools, you can open an issue or use the CRD Extractor to add the schemas to this repository by creating a pull request.

Resources

crds-catalog's People

Contributors

adifayer avatar andyhuynh3 avatar chobostar avatar drinkataco avatar eyarz avatar gilbahat avatar hadar-co avatar ishioni avatar jeffqumata avatar jotasixto avatar kfy-incom avatar ledouxpl avatar lp-francois avatar mghantous avatar reitermarkus avatar shimont avatar shirmondt avatar wyardley avatar yellowhat avatar

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.