mirror of
https://github.com/yannh/kubeconform.git
synced 2026-05-04 17:24:25 +00:00
Publish site
This commit is contained in:
parent
6c1fa513e9
commit
3a3d05b27c
50 changed files with 2310 additions and 0 deletions
78
site/public/docs/json-schema-conversion/index.html
Normal file
78
site/public/docs/json-schema-conversion/index.html
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
<!DOCTYPE html>
|
||||
<html><head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="author" content="Yann Hamon">
|
||||
<link rel="stylesheet" type="text/css" href="/css/style.css"><link rel="stylesheet" type="text/css" href="/css/prism.css">
|
||||
<title>Kubeconform - Fast Kubernetes manifests validation! | Conversion of CRD to JSON Schema</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="main-container"><div id="header">
|
||||
<ul id="navigation">
|
||||
<li><a href="/about">About</a></li>
|
||||
<li><a href="/docs/installation/">Docs</a></li>
|
||||
<li><a href="/">Home</a></li>
|
||||
</ul>
|
||||
<h1>Kubeconform</h1>
|
||||
<h2>A fast Kubernetes manifests validator</h2>
|
||||
</div>
|
||||
<div id="content"><ul id="menu">
|
||||
|
||||
<li><a href="http://kubeconform.mandragor.org/docs/installation/">Installation</a></li>
|
||||
|
||||
<li><a href="http://kubeconform.mandragor.org/docs/usage/">Usage</a></li>
|
||||
|
||||
<li><a href="http://kubeconform.mandragor.org/docs/crd-support/">Custom Resources support</a></li>
|
||||
|
||||
<li><a href="http://kubeconform.mandragor.org/docs/usage-as-github-action/">Github Action</a></li>
|
||||
|
||||
<li><a href="http://kubeconform.mandragor.org/docs/using-as-a-go-module/">Kubeconform as a Go module</a></li>
|
||||
|
||||
<li><a href="http://kubeconform.mandragor.org/docs/json-schema-conversion/">Conversion of CRD to JSON Schema</a></li>
|
||||
|
||||
</ul>
|
||||
<div id="main">
|
||||
|
||||
<div class="navig">
|
||||
|
||||
|
||||
<a href="http://kubeconform.mandragor.org/docs/using-as-a-go-module/" id="next">Kubeconform as a Go module ></a>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content-text">
|
||||
<h1>Conversion of CRD to JSON Schema</h1>
|
||||
<p>Kubeconform uses JSON schemas to validate Kubernetes resources. For custom resources, the CustomResourceDefinition
|
||||
first needs to be converted to JSON Schema. A script is provided to convert these CustomResourceDefinitions
|
||||
to JSON schema. Here is an example how to use it:</p>
|
||||
|
||||
<pre><code class="language-bash">#!/bin/bash
|
||||
$ ./scripts/openapi2jsonschema.py https://raw.githubusercontent.com/aws/amazon-sagemaker-operator-for-k8s/master/config/crd/bases/sagemaker.aws.amazon.com_trainingjobs.yaml
|
||||
JSON schema written to trainingjob_v1.json
|
||||
</code></pre>
|
||||
<p>The <code>FILENAME_FORMAT</code> environment variable can be used to change the output file name (Available variables: <code>kind</code>, <code>group</code>, <code>version</code>) (Default: <code>{kind}_{version}</code>).</p>
|
||||
|
||||
<pre><code class="language-bash">$ export FILENAME_FORMAT='{kind}-{group}-{version}'
|
||||
$ ./scripts/openapi2jsonschema.py https://raw.githubusercontent.com/aws/amazon-sagemaker-operator-for-k8s/master/config/crd/bases/sagemaker.aws.amazon.com_trainingjobs.yaml
|
||||
JSON schema written to trainingjob-sagemaker-v1.json
|
||||
</code></pre>
|
||||
<p>Some CRD schemas do not have explicit validation for fields implicitly validated by the Kubernetes API like <code>apiVersion</code>, <code>kind</code>, and <code>metadata</code>, thus additional properties are allowed at the root of the JSON schema by default, if this is not desired the <code>DENY_ROOT_ADDITIONAL_PROPERTIES</code> environment variable can be set to any non-empty value.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="navig">
|
||||
|
||||
|
||||
<a href="http://kubeconform.mandragor.org/docs/using-as-a-go-module/" id="next">Kubeconform as a Go module ></a>
|
||||
|
||||
</div>
|
||||
|
||||
<script defer src="/js/prism.js"></script>
|
||||
|
||||
</div>
|
||||
</div><div id="footer">
|
||||
Website powered by <a href="https://gohugo.io/">Hugo</a>
|
||||
</div>
|
||||
</div>
|
||||
<script defer src="/js/prism.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue