Flux CRDs json schemas for use with kubeval #408
-
Hello. Are the json schemas for flux CRDs (HelmRelease, GitRepository etc) available somewhere, so that I can use kubeval for validating my manifests? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 16 replies
-
I assume this would mean creating some CI (ideally a reusable github action) which generates the JSON schemas from CRDs in one repo and pushes them to a separate JSON schema github repo, which would then serve as an argument to kubeval's |
Beta Was this translation helpful? Give feedback.
-
This has been implemented in flux2 v0.12.2. Here is an example on how to validate Flux custom resources: # download Flux OpenAPI schemas
mkdir -p /tmp/flux-crd-schemas/master-standalone-strict
curl -sL https://github.com/fluxcd/flux2/releases/latest/download/crd-schemas.tar.gz | tar zxf - -C /tmp/flux-crd-schemas/master-standalone-strict
# validate Flux custom resources
kubeval my-helm-release.yaml --strict --additional-schema-locations=file:///tmp/flux-crd-schemas For an example of how to validate Kubernetes manifests in CI see: fluxcd/flux2-kustomize-helm-example#19 |
Beta Was this translation helpful? Give feedback.
-
Plain text schemas are published here https://github.com/fluxcd-community/flux2-schemas |
Beta Was this translation helpful? Give feedback.
-
Thx @stefanprodan for the Url pointing to Flux CRDs OpenAPI schemas |
Beta Was this translation helpful? Give feedback.
Plain text schemas are published here https://github.com/fluxcd-community/flux2-schemas