Giter VIP home page Giter VIP logo

kubernetes-json-schema's Introduction

Kubernetes JSON Schemas

Fork

This is a fork from instrumenta/kubernetes-json-schema with updated scripts for easier maintenance, as well as schemas for all recent Kubernetes versions.

This repository is kept up-to-date automatically every day using Github Actions.

Usage

Kubeconform

This is the default schema repository used by Kubeconform, and does not need to be specified. When using multiple schema repositories, this repo can be referred to using the alias default.

# All 3 are equivalent
$ kubeconform deployment.yaml
$ kubeconform -schema-location default deployment.yaml
$ kubeconform -schema-location 'https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/{{ .NormalizedKubernetesVersion }}-standalone{{ .StrictSuffix }}/{{ .ResourceKind }}{{ .KindSuffix }}.json' deployment.yaml
Summary: 1 resource found in 1 file - Valid: 1, Invalid: 0, Errors: 0, Skipped: 0

Kubeval

$ kubeval --strict --schema-location https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/ deployment.yaml
PASS - deployment.yaml contains a valid Deployment

To run kubeval against a specific Kubernetes version, pass the -v argument

$ kubeval -v 1.19.8 -s  https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master ingress.yaml
PASS - ingress.yaml contains a valid Ingress (ingress)

Building the schemas yourself

The tooling for generating these schemas is a fork from the original openapi2jsonschema. See build.sh.

It's not Kubernetes specific and should work with other OpenAPI APIs too. This should be useful if you're using a pre-release or otherwise modified version of Kubernetes, or something like OpenShift which extends the standard APIs with additional types.

kubernetes-json-schema's People

Contributors

bai avatar constantin07 avatar garethr avatar hiddeco avatar mavimo avatar volaka avatar yannh 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.