{"id":13740351,"url":"https://github.com/datreeio/crds-catalog","last_synced_at":"2025-05-14T22:08:49.087Z","repository":{"id":37207545,"uuid":"464859166","full_name":"datreeio/CRDs-catalog","owner":"datreeio","description":"Popular Kubernetes CRDs (CustomResourceDefinition) in JSON schema format.","archived":false,"fork":false,"pushed_at":"2025-05-12T17:34:39.000Z","size":10947,"stargazers_count":610,"open_issues_count":40,"forks_count":264,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-05-14T22:08:42.268Z","etag":null,"topics":["crds","customresourcedefinition","jsonschema","kubernetes","schema","shift-left"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/datreeio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"security.istio.io/authorizationpolicy_v1.json","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-03-01T11:06:55.000Z","updated_at":"2025-05-14T07:00:13.000Z","dependencies_parsed_at":"2023-02-18T23:01:13.402Z","dependency_job_id":"1809ccbe-ed54-46c7-9e34-1d91583bf770","html_url":"https://github.com/datreeio/CRDs-catalog","commit_stats":{"total_commits":324,"total_committers":171,"mean_commits":1.894736842105263,"dds":0.8981481481481481,"last_synced_commit":"0af653923de596a1c6a6330f184642e2629396bd"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datreeio%2FCRDs-catalog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datreeio%2FCRDs-catalog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datreeio%2FCRDs-catalog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datreeio%2FCRDs-catalog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datreeio","download_url":"https://codeload.github.com/datreeio/CRDs-catalog/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254235700,"owners_count":22036964,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crds","customresourcedefinition","jsonschema","kubernetes","schema","shift-left"],"created_at":"2024-08-03T04:00:46.680Z","updated_at":"2025-05-14T22:08:44.077Z","avatar_url":"https://github.com/datreeio.png","language":"Python","funding_links":[],"categories":["💻 Projects"],"sub_categories":[],"readme":"# CRDs Catalog\n\nThis repository aggregates hundreds of popular Kubernetes CRDs (`CustomResourceDefinition`) in JSON schema format. These schemas can be used by various tools such as [Datree](https://github.com/datreeio/datree), [Kubeconform](https://github.com/yannh/kubeconform) and [Kubeval](https://github.com/instrumenta/kubeval), as an alternative to `kubectl --dry-run`, to perform validation on custom (and native) Kubernetes resources.  \n\nRunning Kubernetes schema validation checks helps apply the **\"shift-left approach\"** on machines **without** giving them access to your cluster (e.g. locally or on CI).\n\nFurthermore, using the [Red Hat YAML](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) plugin for [VS Code](https://code.visualstudio.com/) you are able to get intellisense and validation for CRDs.\n\n👉 If you encounter custom resources that are not part of the catalog, or you want to validate the schemas in an air-gapped environment, use the [CRD Extractor](#crd-extractor). \n\n## How to use the schemas in the catalog\n### Datree\n```\ndatree test [MANIFEST]\n```\n### Kubeconform\n```\nkubeconform -schema-location default -schema-location 'https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/{{.Group}}/{{.ResourceKind}}_{{.ResourceAPIVersion}}.json' [MANIFEST]\n```\n### kubeval\n```\nOnly supported with the CRD Extractor\n```\n\n### VS Code / Red Hat YAML plugin\nThis mini-guide assumes that you already have the [VS Code](https://code.visualstudio.com/) editor installed along with the [Red Hat YAML](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) plugin.\n\nThe basic idea is that you can annotate your YAML files with a `$schema` property that points to the relevant validation schema. The Red Hat YAML plugin will then use this schema to provide intellisense and validate your YAML files. You can have multiple schema annotations in your files if you have multiple resources in the same file.\n\nThe base URL for the schemas is: `https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/`.\n\nExample:\n```yaml\n---\n# yaml-language-server: $schema=https://datreeio.github.io/CRDs-catalog/cilium.io/ciliumnetworkpolicy_v2.json\napiVersion: cilium.io/v2\nkind: CiliumNetworkPolicy\n[...]\n---\n# yaml-language-server: $schema=https://datreeio.github.io/CRDs-catalog/cilium.io/ciliumegressgatewaypolicy_v2.json\napiVersion: cilium.io/v2\nkind: CiliumEgressGatewayPolicy\n[...]\n```\n\nTo help annotating your YAML documents, you can use the [annotate-yaml](Utilities/annotate-yaml.py) utility script. This script will automatically add the `$schema` property to your YAML documents based on the CRD(s) you are using.\n\n---\n\n## CRD Extractor\n\nThis repository also contains a handy utility that extracts all CRDs from a cluster and converts them to JSON schema.\n\n### What does this utility do?\n1. Checks that the prerequisites are installed.\n2. Extracts your CRDs from your cluster using kubectl.\n3. Using the script from [openapi2jsonschema.py from kubeconform](https://github.com/yannh/kubeconform/blob/master/scripts/openapi2jsonschema.py) to convert your CRDs from openAPI to JSON schema.\n\n### Supported Platforms\n\nThis utility supports **MacOS** and **Linux**.\n\n### Prerequisites\nThe following programs are required to be installed on the machine running this utility:\n* [python3](https://www.python.org/downloads/)\n* [kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl)\n\n### Usage\nTo use the CRD Extractor:  \n1. Download the [latest release](https://github.com/datreeio/CRDs-catalog/releases/latest/download/crd-extractor.zip) from this repository.\n2. Extract, and run the utility:\n```\n./crd-extractor.sh\n```\n\n![image](https://user-images.githubusercontent.com/19731161/185790837-2abadcd5-9b26-451b-b3cd-7e0c46c68b58.png)\n\n---\n\n## Shifting left CRD validation - Video by Datree\n\n\u003ca href=\"https://www.youtube.com/watch?v=YUoH8WNrrwM\" title=\"video text\"\u003e\u003cimg src=\"https://img.youtube.com/vi/YUoH8WNrrwM/maxresdefault.jpg\" width=\"640\" height=\"360\"\u003e\u003c/a\u003e\n\n---\n\n## Contributing CRDs to the catalog\nIf the catalog is missing public custom resources (CRs) that you would like to automatically validate using these tools, you can open an issue or use the **[CRD Extractor](#crd-extractor)** to add the schemas to this repository by creating a pull request.\n\n## Resources\n* [opensource.com - Why you need to use Kubernetes schema validation tools](https://opensource.com/article/21/7/kubernetes-schema-validation)\n* [redhat.com - Validating OpenShift Manifests in a GitOps World](https://cloud.redhat.com/blog/validating-openshift-manifests-in-a-gitops-world)\n* [kubeval/issues/47 - cannot validate CustomResourceDefinitions](https://github.com/instrumenta/kubeval/issues/47)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatreeio%2Fcrds-catalog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatreeio%2Fcrds-catalog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatreeio%2Fcrds-catalog/lists"}