Files
unkinben 784c3b5de1 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>
2026-06-28 17:26:08 +10:00

1347 lines
42 KiB
JSON

{
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"apiVersion": {
"type": "string"
},
"kind": {
"type": "string"
},
"metadata": {
"type": "object"
},
"spec": {
"properties": {
"additionalManifest": {
"nullable": true,
"type": "string"
},
"agentEnvVars": {
"items": {
"properties": {
"name": {
"type": "string"
},
"value": {
"nullable": true,
"type": "string"
}
},
"type": "object"
},
"nullable": true,
"type": "array"
},
"chartValues": {
"nullable": true,
"type": "object",
"x-kubernetes-preserve-unknown-fields": true
},
"clusterName": {
"maxLength": 63,
"type": "string"
},
"dataDirectories": {
"properties": {
"k8sDistro": {
"nullable": true,
"type": "string"
},
"provisioning": {
"nullable": true,
"type": "string"
},
"systemAgent": {
"nullable": true,
"type": "string"
}
},
"type": "object"
},
"etcd": {
"nullable": true,
"properties": {
"disableSnapshots": {
"type": "boolean"
},
"s3": {
"nullable": true,
"properties": {
"bucket": {
"maxLength": 63,
"nullable": true,
"type": "string"
},
"cloudCredentialName": {
"nullable": true,
"type": "string"
},
"endpoint": {
"nullable": true,
"type": "string"
},
"endpointCA": {
"nullable": true,
"type": "string"
},
"folder": {
"nullable": true,
"type": "string"
},
"region": {
"nullable": true,
"type": "string"
},
"skipSSLVerify": {
"type": "boolean"
}
},
"type": "object"
},
"snapshotRetention": {
"type": "integer"
},
"snapshotScheduleCron": {
"nullable": true,
"type": "string"
}
},
"type": "object"
},
"etcdSnapshotCreate": {
"nullable": true,
"properties": {
"generation": {
"type": "integer"
}
},
"type": "object"
},
"etcdSnapshotRestore": {
"nullable": true,
"properties": {
"generation": {
"type": "integer"
},
"name": {
"nullable": true,
"type": "string"
},
"restoreRKEConfig": {
"nullable": true,
"type": "string"
}
},
"type": "object"
},
"kubernetesVersion": {
"nullable": true,
"type": "string"
},
"localClusterAuthEndpoint": {
"properties": {
"caCerts": {
"nullable": true,
"type": "string"
},
"enabled": {
"type": "boolean"
},
"fqdn": {
"nullable": true,
"type": "string"
}
},
"type": "object"
},
"machineGlobalConfig": {
"nullable": true,
"type": "object",
"x-kubernetes-preserve-unknown-fields": true
},
"machineSelectorConfig": {
"items": {
"properties": {
"config": {
"nullable": true,
"type": "object",
"x-kubernetes-preserve-unknown-fields": true
},
"machineLabelSelector": {
"nullable": true,
"properties": {
"matchExpressions": {
"items": {
"properties": {
"key": {
"type": "string"
},
"operator": {
"type": "string"
},
"values": {
"items": {
"type": "string"
},
"type": "array",
"x-kubernetes-list-type": "atomic"
}
},
"required": [
"key",
"operator"
],
"type": "object"
},
"type": "array",
"x-kubernetes-list-type": "atomic"
},
"matchLabels": {
"additionalProperties": {
"type": "string"
},
"type": "object"
}
},
"type": "object",
"x-kubernetes-map-type": "atomic"
}
},
"type": "object"
},
"nullable": true,
"type": "array"
},
"machineSelectorFiles": {
"items": {
"properties": {
"fileSources": {
"items": {
"properties": {
"configMap": {
"properties": {
"defaultPermissions": {
"nullable": true,
"type": "string"
},
"items": {
"items": {
"properties": {
"dynamic": {
"type": "boolean"
},
"hash": {
"nullable": true,
"type": "string"
},
"key": {
"nullable": true,
"type": "string"
},
"path": {
"nullable": true,
"type": "string"
},
"permissions": {
"nullable": true,
"type": "string"
}
},
"required": [
"key",
"path"
],
"type": "object"
},
"nullable": true,
"type": "array"
},
"name": {
"maxLength": 253,
"nullable": true,
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
},
"secret": {
"properties": {
"defaultPermissions": {
"nullable": true,
"type": "string"
},
"items": {
"items": {
"properties": {
"dynamic": {
"type": "boolean"
},
"hash": {
"nullable": true,
"type": "string"
},
"key": {
"nullable": true,
"type": "string"
},
"path": {
"nullable": true,
"type": "string"
},
"permissions": {
"nullable": true,
"type": "string"
}
},
"required": [
"key",
"path"
],
"type": "object"
},
"nullable": true,
"type": "array"
},
"name": {
"maxLength": 253,
"nullable": true,
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
}
},
"type": "object"
},
"nullable": true,
"type": "array"
},
"machineLabelSelector": {
"nullable": true,
"properties": {
"matchExpressions": {
"items": {
"properties": {
"key": {
"type": "string"
},
"operator": {
"type": "string"
},
"values": {
"items": {
"type": "string"
},
"type": "array",
"x-kubernetes-list-type": "atomic"
}
},
"required": [
"key",
"operator"
],
"type": "object"
},
"type": "array",
"x-kubernetes-list-type": "atomic"
},
"matchLabels": {
"additionalProperties": {
"type": "string"
},
"type": "object"
}
},
"type": "object",
"x-kubernetes-map-type": "atomic"
}
},
"type": "object"
},
"nullable": true,
"type": "array"
},
"managementClusterName": {
"type": "string"
},
"networking": {
"nullable": true,
"properties": {
"stackPreference": {
"nullable": true,
"type": "string"
}
},
"type": "object"
},
"provisionGeneration": {
"type": "integer"
},
"registries": {
"nullable": true,
"properties": {
"configs": {
"additionalProperties": {
"properties": {
"authConfigSecretName": {
"maxLength": 253,
"nullable": true,
"type": "string"
},
"caBundle": {
"format": "byte",
"nullable": true,
"type": "string"
},
"insecureSkipVerify": {
"type": "boolean"
},
"tlsSecretName": {
"maxLength": 253,
"nullable": true,
"type": "string"
}
},
"type": "object"
},
"nullable": true,
"type": "object"
},
"mirrors": {
"additionalProperties": {
"properties": {
"endpoint": {
"items": {
"type": "string"
},
"nullable": true,
"type": "array"
},
"rewrite": {
"additionalProperties": {
"type": "string"
},
"nullable": true,
"type": "object"
}
},
"type": "object"
},
"nullable": true,
"type": "object"
}
},
"type": "object"
},
"rotateCertificates": {
"nullable": true,
"properties": {
"generation": {
"format": "int64",
"type": "integer"
},
"services": {
"items": {
"type": "string"
},
"nullable": true,
"type": "array"
}
},
"type": "object"
},
"rotateEncryptionKeys": {
"nullable": true,
"properties": {
"generation": {
"format": "int64",
"type": "integer"
}
},
"type": "object"
},
"unmanagedConfig": {
"type": "boolean"
},
"upgradeStrategy": {
"properties": {
"controlPlaneConcurrency": {
"maxLength": 10,
"nullable": true,
"pattern": "^((([1-9]|[1-9][0-9]|100)%)|([1-9][0-9]*|0)|)$",
"type": "string"
},
"controlPlaneDrainOptions": {
"properties": {
"deleteEmptyDirData": {
"type": "boolean"
},
"disableEviction": {
"type": "boolean"
},
"enabled": {
"type": "boolean"
},
"force": {
"type": "boolean"
},
"gracePeriod": {
"type": "integer"
},
"ignoreDaemonSets": {
"nullable": true,
"type": "boolean"
},
"ignoreErrors": {
"type": "boolean"
},
"postDrainHooks": {
"items": {
"properties": {
"annotation": {
"maxLength": 317,
"nullable": true,
"type": "string"
}
},
"type": "object"
},
"nullable": true,
"type": "array"
},
"preDrainHooks": {
"items": {
"properties": {
"annotation": {
"maxLength": 317,
"nullable": true,
"type": "string"
}
},
"type": "object"
},
"nullable": true,
"type": "array"
},
"skipWaitForDeleteTimeoutSeconds": {
"type": "integer"
},
"timeout": {
"type": "integer"
}
},
"type": "object"
},
"workerConcurrency": {
"maxLength": 10,
"nullable": true,
"pattern": "^((([1-9]|[1-9][0-9]|100)%)|([1-9][0-9]*|0)|)$",
"type": "string"
},
"workerDrainOptions": {
"properties": {
"deleteEmptyDirData": {
"type": "boolean"
},
"disableEviction": {
"type": "boolean"
},
"enabled": {
"type": "boolean"
},
"force": {
"type": "boolean"
},
"gracePeriod": {
"type": "integer"
},
"ignoreDaemonSets": {
"nullable": true,
"type": "boolean"
},
"ignoreErrors": {
"type": "boolean"
},
"postDrainHooks": {
"items": {
"properties": {
"annotation": {
"maxLength": 317,
"nullable": true,
"type": "string"
}
},
"type": "object"
},
"nullable": true,
"type": "array"
},
"preDrainHooks": {
"items": {
"properties": {
"annotation": {
"maxLength": 317,
"nullable": true,
"type": "string"
}
},
"type": "object"
},
"nullable": true,
"type": "array"
},
"skipWaitForDeleteTimeoutSeconds": {
"type": "integer"
},
"timeout": {
"type": "integer"
}
},
"type": "object"
}
},
"type": "object"
}
},
"required": [
"clusterName",
"managementClusterName"
],
"type": "object"
},
"status": {
"properties": {
"agentConnected": {
"type": "boolean"
},
"appliedSpec": {
"properties": {
"additionalManifest": {
"nullable": true,
"type": "string"
},
"agentEnvVars": {
"items": {
"properties": {
"name": {
"type": "string"
},
"value": {
"nullable": true,
"type": "string"
}
},
"type": "object"
},
"nullable": true,
"type": "array"
},
"chartValues": {
"nullable": true,
"type": "object",
"x-kubernetes-preserve-unknown-fields": true
},
"clusterName": {
"maxLength": 63,
"type": "string"
},
"dataDirectories": {
"properties": {
"k8sDistro": {
"nullable": true,
"type": "string"
},
"provisioning": {
"nullable": true,
"type": "string"
},
"systemAgent": {
"nullable": true,
"type": "string"
}
},
"type": "object"
},
"etcd": {
"nullable": true,
"properties": {
"disableSnapshots": {
"type": "boolean"
},
"s3": {
"nullable": true,
"properties": {
"bucket": {
"maxLength": 63,
"nullable": true,
"type": "string"
},
"cloudCredentialName": {
"nullable": true,
"type": "string"
},
"endpoint": {
"nullable": true,
"type": "string"
},
"endpointCA": {
"nullable": true,
"type": "string"
},
"folder": {
"nullable": true,
"type": "string"
},
"region": {
"nullable": true,
"type": "string"
},
"skipSSLVerify": {
"type": "boolean"
}
},
"type": "object"
},
"snapshotRetention": {
"type": "integer"
},
"snapshotScheduleCron": {
"nullable": true,
"type": "string"
}
},
"type": "object"
},
"etcdSnapshotCreate": {
"nullable": true,
"properties": {
"generation": {
"type": "integer"
}
},
"type": "object"
},
"etcdSnapshotRestore": {
"nullable": true,
"properties": {
"generation": {
"type": "integer"
},
"name": {
"nullable": true,
"type": "string"
},
"restoreRKEConfig": {
"nullable": true,
"type": "string"
}
},
"type": "object"
},
"kubernetesVersion": {
"nullable": true,
"type": "string"
},
"localClusterAuthEndpoint": {
"properties": {
"caCerts": {
"nullable": true,
"type": "string"
},
"enabled": {
"type": "boolean"
},
"fqdn": {
"nullable": true,
"type": "string"
}
},
"type": "object"
},
"machineGlobalConfig": {
"nullable": true,
"type": "object",
"x-kubernetes-preserve-unknown-fields": true
},
"machineSelectorConfig": {
"items": {
"properties": {
"config": {
"nullable": true,
"type": "object",
"x-kubernetes-preserve-unknown-fields": true
},
"machineLabelSelector": {
"nullable": true,
"properties": {
"matchExpressions": {
"items": {
"properties": {
"key": {
"type": "string"
},
"operator": {
"type": "string"
},
"values": {
"items": {
"type": "string"
},
"type": "array",
"x-kubernetes-list-type": "atomic"
}
},
"required": [
"key",
"operator"
],
"type": "object"
},
"type": "array",
"x-kubernetes-list-type": "atomic"
},
"matchLabels": {
"additionalProperties": {
"type": "string"
},
"type": "object"
}
},
"type": "object",
"x-kubernetes-map-type": "atomic"
}
},
"type": "object"
},
"nullable": true,
"type": "array"
},
"machineSelectorFiles": {
"items": {
"properties": {
"fileSources": {
"items": {
"properties": {
"configMap": {
"properties": {
"defaultPermissions": {
"nullable": true,
"type": "string"
},
"items": {
"items": {
"properties": {
"dynamic": {
"type": "boolean"
},
"hash": {
"nullable": true,
"type": "string"
},
"key": {
"nullable": true,
"type": "string"
},
"path": {
"nullable": true,
"type": "string"
},
"permissions": {
"nullable": true,
"type": "string"
}
},
"required": [
"key",
"path"
],
"type": "object"
},
"nullable": true,
"type": "array"
},
"name": {
"maxLength": 253,
"nullable": true,
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
},
"secret": {
"properties": {
"defaultPermissions": {
"nullable": true,
"type": "string"
},
"items": {
"items": {
"properties": {
"dynamic": {
"type": "boolean"
},
"hash": {
"nullable": true,
"type": "string"
},
"key": {
"nullable": true,
"type": "string"
},
"path": {
"nullable": true,
"type": "string"
},
"permissions": {
"nullable": true,
"type": "string"
}
},
"required": [
"key",
"path"
],
"type": "object"
},
"nullable": true,
"type": "array"
},
"name": {
"maxLength": 253,
"nullable": true,
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
}
},
"type": "object"
},
"nullable": true,
"type": "array"
},
"machineLabelSelector": {
"nullable": true,
"properties": {
"matchExpressions": {
"items": {
"properties": {
"key": {
"type": "string"
},
"operator": {
"type": "string"
},
"values": {
"items": {
"type": "string"
},
"type": "array",
"x-kubernetes-list-type": "atomic"
}
},
"required": [
"key",
"operator"
],
"type": "object"
},
"type": "array",
"x-kubernetes-list-type": "atomic"
},
"matchLabels": {
"additionalProperties": {
"type": "string"
},
"type": "object"
}
},
"type": "object",
"x-kubernetes-map-type": "atomic"
}
},
"type": "object"
},
"nullable": true,
"type": "array"
},
"managementClusterName": {
"type": "string"
},
"networking": {
"nullable": true,
"properties": {
"stackPreference": {
"nullable": true,
"type": "string"
}
},
"type": "object"
},
"provisionGeneration": {
"type": "integer"
},
"registries": {
"nullable": true,
"properties": {
"configs": {
"additionalProperties": {
"properties": {
"authConfigSecretName": {
"maxLength": 253,
"nullable": true,
"type": "string"
},
"caBundle": {
"format": "byte",
"nullable": true,
"type": "string"
},
"insecureSkipVerify": {
"type": "boolean"
},
"tlsSecretName": {
"maxLength": 253,
"nullable": true,
"type": "string"
}
},
"type": "object"
},
"nullable": true,
"type": "object"
},
"mirrors": {
"additionalProperties": {
"properties": {
"endpoint": {
"items": {
"type": "string"
},
"nullable": true,
"type": "array"
},
"rewrite": {
"additionalProperties": {
"type": "string"
},
"nullable": true,
"type": "object"
}
},
"type": "object"
},
"nullable": true,
"type": "object"
}
},
"type": "object"
},
"rotateCertificates": {
"nullable": true,
"properties": {
"generation": {
"format": "int64",
"type": "integer"
},
"services": {
"items": {
"type": "string"
},
"nullable": true,
"type": "array"
}
},
"type": "object"
},
"rotateEncryptionKeys": {
"nullable": true,
"properties": {
"generation": {
"format": "int64",
"type": "integer"
}
},
"type": "object"
},
"unmanagedConfig": {
"type": "boolean"
},
"upgradeStrategy": {
"properties": {
"controlPlaneConcurrency": {
"maxLength": 10,
"nullable": true,
"pattern": "^((([1-9]|[1-9][0-9]|100)%)|([1-9][0-9]*|0)|)$",
"type": "string"
},
"controlPlaneDrainOptions": {
"properties": {
"deleteEmptyDirData": {
"type": "boolean"
},
"disableEviction": {
"type": "boolean"
},
"enabled": {
"type": "boolean"
},
"force": {
"type": "boolean"
},
"gracePeriod": {
"type": "integer"
},
"ignoreDaemonSets": {
"nullable": true,
"type": "boolean"
},
"ignoreErrors": {
"type": "boolean"
},
"postDrainHooks": {
"items": {
"properties": {
"annotation": {
"maxLength": 317,
"nullable": true,
"type": "string"
}
},
"type": "object"
},
"nullable": true,
"type": "array"
},
"preDrainHooks": {
"items": {
"properties": {
"annotation": {
"maxLength": 317,
"nullable": true,
"type": "string"
}
},
"type": "object"
},
"nullable": true,
"type": "array"
},
"skipWaitForDeleteTimeoutSeconds": {
"type": "integer"
},
"timeout": {
"type": "integer"
}
},
"type": "object"
},
"workerConcurrency": {
"maxLength": 10,
"nullable": true,
"pattern": "^((([1-9]|[1-9][0-9]|100)%)|([1-9][0-9]*|0)|)$",
"type": "string"
},
"workerDrainOptions": {
"properties": {
"deleteEmptyDirData": {
"type": "boolean"
},
"disableEviction": {
"type": "boolean"
},
"enabled": {
"type": "boolean"
},
"force": {
"type": "boolean"
},
"gracePeriod": {
"type": "integer"
},
"ignoreDaemonSets": {
"nullable": true,
"type": "boolean"
},
"ignoreErrors": {
"type": "boolean"
},
"postDrainHooks": {
"items": {
"properties": {
"annotation": {
"maxLength": 317,
"nullable": true,
"type": "string"
}
},
"type": "object"
},
"nullable": true,
"type": "array"
},
"preDrainHooks": {
"items": {
"properties": {
"annotation": {
"maxLength": 317,
"nullable": true,
"type": "string"
}
},
"type": "object"
},
"nullable": true,
"type": "array"
},
"skipWaitForDeleteTimeoutSeconds": {
"type": "integer"
},
"timeout": {
"type": "integer"
}
},
"type": "object"
}
},
"type": "object"
}
},
"required": [
"clusterName",
"managementClusterName"
],
"type": "object"
},
"certificateRotationGeneration": {
"format": "int64",
"type": "integer"
},
"conditions": {
"items": {
"properties": {
"lastTransitionTime": {
"type": "string"
},
"lastUpdateTime": {
"type": "string"
},
"message": {
"type": "string"
},
"reason": {
"type": "string"
},
"status": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"status",
"type"
],
"type": "object"
},
"type": "array"
},
"configGeneration": {
"format": "int64",
"type": "integer"
},
"etcdSnapshotCreate": {
"properties": {
"generation": {
"type": "integer"
}
},
"type": "object"
},
"etcdSnapshotCreatePhase": {
"enum": [
"Started",
"RestartCluster",
"Finished",
"Failed"
],
"type": "string"
},
"etcdSnapshotRestore": {
"properties": {
"generation": {
"type": "integer"
},
"name": {
"nullable": true,
"type": "string"
},
"restoreRKEConfig": {
"nullable": true,
"type": "string"
}
},
"type": "object"
},
"etcdSnapshotRestorePhase": {
"enum": [
"Started",
"Shutdown",
"Restore",
"PostRestorePodCleanup",
"InitialRestartCluster",
"PostRestoreNodeCleanup",
"RestartCluster",
"Finished",
"Failed"
],
"type": "string"
},
"initialized": {
"type": "boolean"
},
"observedGeneration": {
"format": "int64",
"type": "integer"
},
"ready": {
"type": "boolean"
},
"rotateEncryptionKeys": {
"properties": {
"generation": {
"format": "int64",
"type": "integer"
}
},
"type": "object"
},
"rotateEncryptionKeysLeader": {
"type": "string"
},
"rotateEncryptionKeysPhase": {
"type": "string"
}
},
"required": [
"observedGeneration"
],
"type": "object"
}
},
"type": "object"
}