Skip to content

Commit

Permalink
updated README with more recent versions and URL
Browse files Browse the repository at this point in the history
  • Loading branch information
garethr committed Apr 6, 2019
1 parent 5604fca commit b096383
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
21 changes: 12 additions & 9 deletions README.md
@@ -1,7 +1,5 @@
# Kubernetes JSON Schemas

[![Build Status](https://travis-ci.org/garethr/kubernetes-json-schema.svg?branch=master)](https://travis-ci.org/garethr/kubernetes-json-schema)

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
Expand All @@ -24,14 +22,19 @@ 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](https://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](https://kubernetesjsonschema.dev/v1.14.0-standalone/pod-v1.json)

## Example

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

* [v1.6.6/deployment.json](v1.6.6/deployment.json)
* [v1.6.6-standalone/deployment.json](v1.6.6-standalone/deployment.json)
* [v1.6.6-local/deployment.json](v1.6.6-local/deployment.json)
* [v1.6.6-strict/deployment.json](v1.6.6-strict/deployment.json)
* [v1.14.0/deployment.json](v1.14.0/deployment.json)
* [v1.14.0-standalone/deployment.json](v1.14.0-standalone/deployment.json)
* [v1.14.0-local/deployment.json](v1.14.0-local/deployment.json)
* [v1.14.0-standalone-strict/deployment.json](v1.14.0-standalone-strict/deployment.json)

## Usage

Expand All @@ -42,7 +45,7 @@ validate a Kubernetes definition.
Here is a very simply example using the Python [jsonschema client](https://github.com/Julian/jsonschema) and an invalid deployment file:

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

Expand Down Expand Up @@ -77,7 +80,7 @@ to the approach I ended up taking.
## Building the schemas yourself

The tooling for generating these schemas is [openapi2jsonschema](https://github.com/garethr/openapi2jsonschema).
It's not Kubernetes specific and should work with other OpenAPI specificied
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.
16 changes: 7 additions & 9 deletions build.sh
Expand Up @@ -5,14 +5,11 @@
#
# X.Y.Z - URL referenced based on the specified GitHub repository
# X.Y.Z-standalone - de-referenced schemas, more useful as standalone documents
# X.Y.Z-standalone-strict - de-referenced schemas, more useful as standalone documents, additionalProperties disallowed
# X.Y.Z-local - relative references, useful to avoid the network dependency

declare -a arr=(
#master
v1.14.0
)

declare -a old=(
master
v1.14.0
v1.13.5
v1.13.4
Expand All @@ -23,14 +20,14 @@ declare -a old=(
v1.12.6
v1.12.5
v1.12.4
v1.11.9
v1.11.8
v1.11.7
v1.11.6
v1.12.3
v1.12.2
v1.12.1
v1.12.0
v1.11.9
v1.11.8
v1.11.7
v1.11.6
v1.11.5
v1.11.4
v1.11.3
Expand Down Expand Up @@ -87,6 +84,7 @@ declare -a old=(
v1.7.2
v1.7.1
v1.7.0

v1.6.13
v1.6.12
v1.6.11
Expand Down

0 comments on commit b096383

Please sign in to comment.