All Projects → instrumenta → Kubernetes Json Schema

instrumenta / Kubernetes Json Schema

Licence: other
Schemas for every version of every object in every version of Kubernetes

Projects that are alternatives of or similar to Kubernetes Json Schema

Ajv I18n
Internationalised error messages for Ajv JSON-Schema validator
Stars: ✭ 98 (-30%)
Mutual labels:  json-schema
Liform
PHP library to render Symfony Forms to JSON Schema
Stars: ✭ 113 (-19.29%)
Mutual labels:  json-schema
Liformbundle
Symfony Bundle to render Symfony Forms to JSON Schema
Stars: ✭ 124 (-11.43%)
Mutual labels:  json-schema
Json Node Normalizer
'json-node-normalizer' - NodeJS module that normalize json data types from json schema specifications.
Stars: ✭ 105 (-25%)
Mutual labels:  json-schema
Go Jsonschema Generator
json-schemas generator based on Go types
Stars: ✭ 110 (-21.43%)
Mutual labels:  json-schema
Npoint
JSON storage bins with schema validation
Stars: ✭ 116 (-17.14%)
Mutual labels:  json-schema
Jesse
jesse (JSon Schema Erlang) is an implementation of a JSON Schema validator for Erlang.
Stars: ✭ 92 (-34.29%)
Mutual labels:  json-schema
Json Schema To Typescript
Compile JSONSchema to TypeScript type declarations
Stars: ✭ 1,917 (+1269.29%)
Mutual labels:  json-schema
Jsonschema
JSON Schema validation
Stars: ✭ 1,575 (+1025%)
Mutual labels:  json-schema
Lurker
📖 The ultimate tool for documenting and testing APIs in Rails
Stars: ✭ 120 (-14.29%)
Mutual labels:  json-schema
React Jsonschema Form
A React component for building Web forms from JSON Schema.
Stars: ✭ 10,870 (+7664.29%)
Mutual labels:  json-schema
Schema Registry
Confluent Schema Registry for Kafka
Stars: ✭ 1,647 (+1076.43%)
Mutual labels:  json-schema
Class Validator Jsonschema
Convert class-validator-decorated classes into JSON schema
Stars: ✭ 118 (-15.71%)
Mutual labels:  json-schema
Laravel Json Schema
Create all your migrations and models from one JSON schema file.
Stars: ✭ 101 (-27.86%)
Mutual labels:  json-schema
Xsd2json
Translate XML Schema into equivalent JSON Schema
Stars: ✭ 124 (-11.43%)
Mutual labels:  json-schema
React Jsonschema Form Material Ui
📜 React - Material UI components for building Web forms from JSON Schema.
Stars: ✭ 95 (-32.14%)
Mutual labels:  json-schema
Hypothesis Jsonschema
Tools to generate test data from JSON schemata with Hypothesis
Stars: ✭ 112 (-20%)
Mutual labels:  json-schema
Libvirt Hook Qemu
Libvirt hook for setting up iptables port-forwarding rules when using NAT-ed networking.
Stars: ✭ 137 (-2.14%)
Mutual labels:  json-schema
React Json Schema
Configure and build views using JSON schemas mapped to React components
Stars: ✭ 131 (-6.43%)
Mutual labels:  json-schema
Typedload
Python library to load dynamically typed data into statically typed data structures
Stars: ✭ 120 (-14.29%)
Mutual labels:  json-schema

Kubernetes JSON Schemas

Netlify Status

While exploring tooling for Kubernetes I had need for schemas to describe the definition files, and went looking for something that didn't require either kubectl or similar installed or even a working Kubernetes installation.

It turns out that the OpenAPI specification contain this information, but not in a particularly usable format for tools which might just want a raw JSON Schema.

This repository contains a set of schemas for most recent Kubernetes versions. For each specified Kubernetes versions you should find four different flavours:

  • vX.Y.Z - URL referenced based on the specified GitHub repository
  • vX.Y.Z-standalone - de-referenced schemas, more useful as standalone documents
  • vX.Y.Z-local - relative references, useful to avoid the network dependency
  • vX.Y.Z-strict - prohibits properties not defined in the schema

Note that the Kubernetes API allows additional properties to be submitted, but kubectl acts like the strict flavour above.

kubernetesjsonschema.dev

The schemas are now all available from kubernetesjsonschema.dev, for instance the schema for v1 of the Pod object is Kubernetes 1.14.0 is available at: kubernetesjsonschema.dev/v1.14.0-standalone/pod-v1.json

Example

Here are the links to the deployment schemas for Kubernetes 1.14.0:

Usage

There are lots of use cases for these schemas, they are primarily useful as a low-level part of other developer workflow tools. But at a most basic level you can validate a Kubernetes definition.

Here is a very simply example using the Python jsonschema client and an invalid deployment file:

$ jsonschema -F "{error.message}" -i hello-nginx.json v1.14.0-standalone/deployment.json
u'template' is a required property

Specific ideas

As noted these schemas have lots of potential uses for development tools. Here are a few ideas, some of which I've been hacking on:

  • Demonstrating using with the more common YAML serialisation
  • Testing tools to show your Kubernetes configuration files are valid, and against which versions of Kubernetes
  • Migration tools to check your config files are still valid against master or beta releases
  • Integration with code editors, for instance via something like Schema Store
  • Validation of Kubernetes configs generated by higher-level tools, like Helm, Ksonnet or Puppet
  • Visual tools for crafting Kubernetes configurations
  • Tools to show changes between Kubernetes versions

Prior-art

The discussion around wanting JSON Schemas for Kubernetes types has cropped up in a few places, but there are some useful comments on this issue. Joël Harkes reached a similar conclusion to the approach I ended up taking.

Building the schemas yourself

The tooling for generating these schemas is openapi2jsonschema. 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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].