Add JSON schema generation for kubeconform CRD validation (#212)

## Summary
- New `ci/generate-schemas.sh` script that generates JSON schemas from three sources:
  1. Live cluster CRDs via `kubectl get crds`
  2. Offline CRD manifests (ArgoCD v3.3.2, Gateway API v1.5.1)
  3. Kubernetes v1.33.7 swagger spec for native types
- Schemas follow Datree catalog convention (`<group>/<Kind>_<version>.json`)
- `validate-apps.sh` and `validate-clusters.sh` check local schemas first, falling back to remote
- Fixes TLSRoute (and other CRD) schema validation failures in kubeconform

## Sources
- ArgoCD: `artifactapi.../argoproj/argo-cd/refs/tags/v3.3.2/manifests/ha/install.yaml`
- Gateway API: `artifactapi.../kubernetes-sigs/gateway-api/releases/download/v1.5.1/standard-install.yaml`
- Kubernetes: `artifactapi.../kubernetes/kubernetes/refs/tags/v1.33.7/api/openapi-spec/swagger.json`

Reviewed-on: #212
Co-authored-by: Ben Vincent <ben@unkin.net>
Co-committed-by: Ben Vincent <ben@unkin.net>
This commit was merged in pull request #212.
This commit is contained in:
2026-06-28 17:26:08 +10:00
committed by BenVincent
parent cfca1e5278
commit 784c3b5de1
264 changed files with 142907 additions and 2 deletions
@@ -0,0 +1,209 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"accessKey": {
"default": "",
"nullable": true,
"type": "string"
},
"ami": {
"default": "",
"nullable": true,
"type": "string"
},
"apiVersion": {
"type": "string"
},
"blockDurationMinutes": {
"default": "0",
"nullable": true,
"type": "string"
},
"deviceName": {
"default": "",
"nullable": true,
"type": "string"
},
"enablePrimaryIpv6": {
"default": false,
"type": "boolean"
},
"encryptEbsVolume": {
"default": false,
"type": "boolean"
},
"endpoint": {
"default": "",
"nullable": true,
"type": "string"
},
"httpEndpoint": {
"default": "",
"nullable": true,
"type": "string"
},
"httpProtocolIpv6": {
"default": "disabled",
"nullable": true,
"type": "string"
},
"httpTokens": {
"default": "",
"nullable": true,
"type": "string"
},
"iamInstanceProfile": {
"default": "",
"nullable": true,
"type": "string"
},
"insecureTransport": {
"default": false,
"type": "boolean"
},
"instanceType": {
"default": "t2.micro",
"nullable": true,
"type": "string"
},
"ipv6AddressCount": {
"default": "0",
"nullable": true,
"type": "string"
},
"ipv6AddressOnly": {
"default": false,
"type": "boolean"
},
"keypairName": {
"default": "",
"nullable": true,
"type": "string"
},
"kind": {
"type": "string"
},
"kmsKey": {
"default": "",
"nullable": true,
"type": "string"
},
"metadata": {
"type": "object"
},
"monitoring": {
"default": false,
"type": "boolean"
},
"openPort": {
"items": {
"nullable": true,
"type": "string"
},
"nullable": true,
"type": "array"
},
"privateAddressOnly": {
"default": false,
"type": "boolean"
},
"region": {
"default": "us-east-1",
"nullable": true,
"type": "string"
},
"requestSpotInstance": {
"default": false,
"type": "boolean"
},
"retries": {
"default": "5",
"nullable": true,
"type": "string"
},
"rootSize": {
"default": "16",
"nullable": true,
"type": "string"
},
"secretKey": {
"default": "",
"nullable": true,
"type": "string"
},
"securityGroup": {
"default": [
"rancher-nodes"
],
"items": {
"nullable": true,
"type": "string"
},
"nullable": true,
"type": "array"
},
"securityGroupReadonly": {
"default": false,
"type": "boolean"
},
"sessionToken": {
"default": "",
"nullable": true,
"type": "string"
},
"spotPrice": {
"default": "0.50",
"nullable": true,
"type": "string"
},
"sshKeyContents": {
"default": "",
"nullable": true,
"type": "string"
},
"sshUser": {
"default": "ubuntu",
"nullable": true,
"type": "string"
},
"subnetId": {
"default": "",
"nullable": true,
"type": "string"
},
"tags": {
"default": "",
"nullable": true,
"type": "string"
},
"useEbsOptimizedInstance": {
"default": false,
"type": "boolean"
},
"usePrivateAddress": {
"default": false,
"type": "boolean"
},
"userdata": {
"default": "",
"nullable": true,
"type": "string"
},
"volumeType": {
"default": "gp2",
"nullable": true,
"type": "string"
},
"vpcId": {
"default": "",
"nullable": true,
"type": "string"
},
"zone": {
"default": "a",
"nullable": true,
"type": "string"
}
},
"type": "object"
}
@@ -0,0 +1,177 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"acceleratedNetworking": {
"default": false,
"type": "boolean"
},
"apiVersion": {
"type": "string"
},
"availabilitySet": {
"default": "docker-machine",
"nullable": true,
"type": "string"
},
"availabilityZone": {
"default": "",
"nullable": true,
"type": "string"
},
"clientId": {
"default": "",
"nullable": true,
"type": "string"
},
"clientSecret": {
"default": "",
"nullable": true,
"type": "string"
},
"customData": {
"default": "",
"nullable": true,
"type": "string"
},
"diskSize": {
"default": "30",
"nullable": true,
"type": "string"
},
"dns": {
"default": "",
"nullable": true,
"type": "string"
},
"dockerPort": {
"default": "2376",
"nullable": true,
"type": "string"
},
"enablePublicIpStandardSku": {
"default": false,
"type": "boolean"
},
"environment": {
"default": "AzurePublicCloud",
"nullable": true,
"type": "string"
},
"faultDomainCount": {
"default": "3",
"nullable": true,
"type": "string"
},
"image": {
"default": "canonical:ubuntu-24_04-lts:server-gen1:latest",
"nullable": true,
"type": "string"
},
"kind": {
"type": "string"
},
"location": {
"default": "westus",
"nullable": true,
"type": "string"
},
"managedDisks": {
"default": false,
"type": "boolean"
},
"metadata": {
"type": "object"
},
"noPublicIp": {
"default": false,
"type": "boolean"
},
"nsg": {
"default": "",
"nullable": true,
"type": "string"
},
"openPort": {
"items": {
"nullable": true,
"type": "string"
},
"nullable": true,
"type": "array"
},
"plan": {
"default": "",
"nullable": true,
"type": "string"
},
"privateIpAddress": {
"default": "",
"nullable": true,
"type": "string"
},
"resourceGroup": {
"default": "docker-machine",
"nullable": true,
"type": "string"
},
"size": {
"default": "Standard_D2_v2",
"nullable": true,
"type": "string"
},
"sshUser": {
"default": "docker-user",
"nullable": true,
"type": "string"
},
"staticPublicIp": {
"default": false,
"type": "boolean"
},
"storageType": {
"default": "Standard_LRS",
"nullable": true,
"type": "string"
},
"subnet": {
"default": "docker-machine",
"nullable": true,
"type": "string"
},
"subnetPrefix": {
"default": "192.168.0.0/16",
"nullable": true,
"type": "string"
},
"subscriptionId": {
"default": "",
"nullable": true,
"type": "string"
},
"tags": {
"default": "",
"nullable": true,
"type": "string"
},
"tenantId": {
"default": "",
"nullable": true,
"type": "string"
},
"updateDomainCount": {
"default": "5",
"nullable": true,
"type": "string"
},
"usePrivateIp": {
"default": false,
"type": "boolean"
},
"vnet": {
"default": "docker-machine-vnet",
"nullable": true,
"type": "string"
}
},
"type": "object"
}
@@ -0,0 +1,81 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"accessToken": {
"default": "",
"nullable": true,
"type": "string"
},
"apiVersion": {
"type": "string"
},
"backups": {
"default": false,
"type": "boolean"
},
"image": {
"default": "ubuntu-20-04-x64",
"nullable": true,
"type": "string"
},
"ipv6": {
"default": false,
"type": "boolean"
},
"kind": {
"type": "string"
},
"metadata": {
"type": "object"
},
"monitoring": {
"default": false,
"type": "boolean"
},
"privateNetworking": {
"default": false,
"type": "boolean"
},
"region": {
"default": "nyc3",
"nullable": true,
"type": "string"
},
"size": {
"default": "s-1vcpu-1gb",
"nullable": true,
"type": "string"
},
"sshKeyContents": {
"default": "",
"nullable": true,
"type": "string"
},
"sshKeyFingerprint": {
"default": "",
"nullable": true,
"type": "string"
},
"sshPort": {
"default": "22",
"nullable": true,
"type": "string"
},
"sshUser": {
"default": "root",
"nullable": true,
"type": "string"
},
"tags": {
"default": "",
"nullable": true,
"type": "string"
},
"userdata": {
"default": "",
"nullable": true,
"type": "string"
}
},
"type": "object"
}
@@ -0,0 +1,165 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"apiVersion": {
"type": "string"
},
"cloudConfig": {
"default": "",
"nullable": true,
"type": "string"
},
"clusterId": {
"default": "",
"nullable": true,
"type": "string"
},
"clusterName": {
"default": "",
"nullable": true,
"type": "string"
},
"clusterType": {
"default": "",
"nullable": true,
"type": "string"
},
"cpuCount": {
"default": "2",
"nullable": true,
"type": "string"
},
"cpuPinning": {
"default": false,
"type": "boolean"
},
"diskBus": {
"default": "",
"nullable": true,
"type": "string"
},
"diskInfo": {
"default": "",
"nullable": true,
"type": "string"
},
"diskSize": {
"default": "0",
"nullable": true,
"type": "string"
},
"enableEfi": {
"default": false,
"type": "boolean"
},
"enableSecureBoot": {
"default": false,
"type": "boolean"
},
"enableTpm": {
"default": false,
"type": "boolean"
},
"imageName": {
"default": "",
"nullable": true,
"type": "string"
},
"isolateEmulatorThread": {
"default": false,
"type": "boolean"
},
"keyPairName": {
"default": "",
"nullable": true,
"type": "string"
},
"kind": {
"type": "string"
},
"kubeconfigContent": {
"default": "",
"nullable": true,
"type": "string"
},
"memorySize": {
"default": "4",
"nullable": true,
"type": "string"
},
"metadata": {
"type": "object"
},
"networkData": {
"default": "",
"nullable": true,
"type": "string"
},
"networkInfo": {
"default": "",
"nullable": true,
"type": "string"
},
"networkModel": {
"default": "",
"nullable": true,
"type": "string"
},
"networkName": {
"default": "",
"nullable": true,
"type": "string"
},
"networkType": {
"default": "",
"nullable": true,
"type": "string"
},
"reservedMemorySize": {
"default": "-1",
"nullable": true,
"type": "string"
},
"sshPassword": {
"default": "",
"nullable": true,
"type": "string"
},
"sshPort": {
"default": "22",
"nullable": true,
"type": "string"
},
"sshPrivateKeyPath": {
"default": "",
"nullable": true,
"type": "string"
},
"sshUser": {
"default": "root",
"nullable": true,
"type": "string"
},
"userData": {
"default": "",
"nullable": true,
"type": "string"
},
"vgpuInfo": {
"default": "",
"nullable": true,
"type": "string"
},
"vmAffinity": {
"default": "",
"nullable": true,
"type": "string"
},
"vmNamespace": {
"default": "default",
"nullable": true,
"type": "string"
}
},
"type": "object"
}
@@ -0,0 +1,94 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"apiVersion": {
"type": "string"
},
"authorizedUsers": {
"default": "",
"nullable": true,
"type": "string"
},
"createPrivateIp": {
"default": false,
"type": "boolean"
},
"dockerPort": {
"default": "2376",
"nullable": true,
"type": "string"
},
"image": {
"default": "linode/ubuntu18.04",
"nullable": true,
"type": "string"
},
"instanceType": {
"default": "g6-standard-4",
"nullable": true,
"type": "string"
},
"kind": {
"type": "string"
},
"label": {
"default": "",
"nullable": true,
"type": "string"
},
"metadata": {
"type": "object"
},
"region": {
"default": "us-east",
"nullable": true,
"type": "string"
},
"rootPass": {
"default": "",
"nullable": true,
"type": "string"
},
"sshPort": {
"default": "22",
"nullable": true,
"type": "string"
},
"sshUser": {
"default": "",
"nullable": true,
"type": "string"
},
"stackscript": {
"default": "",
"nullable": true,
"type": "string"
},
"stackscriptData": {
"default": "",
"nullable": true,
"type": "string"
},
"swapSize": {
"default": "512",
"nullable": true,
"type": "string"
},
"tags": {
"default": "",
"nullable": true,
"type": "string"
},
"token": {
"default": "",
"nullable": true,
"type": "string"
},
"uaPrefix": {
"default": "",
"nullable": true,
"type": "string"
}
},
"type": "object"
}
@@ -0,0 +1,241 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"apiVersion": {
"type": "string"
},
"boot2dockerUrl": {
"default": "",
"nullable": true,
"type": "string"
},
"cfgparam": {
"items": {
"nullable": true,
"type": "string"
},
"nullable": true,
"type": "array"
},
"cloneFrom": {
"default": "",
"nullable": true,
"type": "string"
},
"cloudConfig": {
"default": "",
"nullable": true,
"type": "string"
},
"cloudinit": {
"default": "",
"nullable": true,
"type": "string"
},
"common": {
"properties": {
"cloudCredentialSecretName": {
"nullable": true,
"type": "string"
},
"labels": {
"additionalProperties": {
"nullable": true,
"type": "string"
},
"nullable": true,
"type": "object"
},
"taints": {
"items": {
"properties": {
"effect": {
"nullable": true,
"type": "string"
},
"key": {
"nullable": true,
"type": "string"
},
"timeAdded": {
"nullable": true,
"type": "string"
},
"value": {
"nullable": true,
"type": "string"
}
},
"type": "object"
},
"nullable": true,
"type": "array"
}
},
"type": "object"
},
"contentLibrary": {
"default": "",
"nullable": true,
"type": "string"
},
"cpuCount": {
"default": "2",
"nullable": true,
"type": "string"
},
"creationType": {
"default": "legacy",
"nullable": true,
"type": "string"
},
"customAttribute": {
"items": {
"nullable": true,
"type": "string"
},
"nullable": true,
"type": "array"
},
"datacenter": {
"default": "",
"nullable": true,
"type": "string"
},
"datastore": {
"default": "",
"nullable": true,
"type": "string"
},
"datastoreCluster": {
"default": "",
"nullable": true,
"type": "string"
},
"diskSize": {
"default": "20480",
"nullable": true,
"type": "string"
},
"folder": {
"default": "",
"nullable": true,
"type": "string"
},
"gracefulShutdownTimeout": {
"default": "0",
"nullable": true,
"type": "string"
},
"hostsystem": {
"default": "",
"nullable": true,
"type": "string"
},
"kind": {
"type": "string"
},
"memorySize": {
"default": "2048",
"nullable": true,
"type": "string"
},
"metadata": {
"type": "object"
},
"network": {
"items": {
"nullable": true,
"type": "string"
},
"nullable": true,
"type": "array"
},
"os": {
"default": "linux",
"nullable": true,
"type": "string"
},
"password": {
"default": "",
"nullable": true,
"type": "string"
},
"pool": {
"default": "",
"nullable": true,
"type": "string"
},
"providerID": {
"nullable": true,
"type": "string"
},
"sshPassword": {
"default": "tcuser",
"nullable": true,
"type": "string"
},
"sshPort": {
"default": "22",
"nullable": true,
"type": "string"
},
"sshUser": {
"default": "docker",
"nullable": true,
"type": "string"
},
"sshUserGroup": {
"default": "staff",
"nullable": true,
"type": "string"
},
"tag": {
"items": {
"nullable": true,
"type": "string"
},
"nullable": true,
"type": "array"
},
"username": {
"default": "",
"nullable": true,
"type": "string"
},
"vappIpallocationpolicy": {
"default": "",
"nullable": true,
"type": "string"
},
"vappIpprotocol": {
"default": "",
"nullable": true,
"type": "string"
},
"vappProperty": {
"items": {
"nullable": true,
"type": "string"
},
"nullable": true,
"type": "array"
},
"vappTransport": {
"default": "",
"nullable": true,
"type": "string"
},
"vcenter": {
"default": "",
"nullable": true,
"type": "string"
},
"vcenterPort": {
"default": "443",
"nullable": true,
"type": "string"
}
},
"type": "object"
}