kubeval: Validate Manifests (Legacy)
kubeval <files> validates manifests against bundled Kubernetes JSON schemas; it is now unmaintained, with kubeconform as the recommended replacement.
kubeval pioneered offline manifest validation and still appears in older pipelines. It works, but it is no longer maintained, so new pipelines should reach for kubeconform.
What it does
kubeval reads each manifest, looks up the schema for its apiVersion/kind, and reports whether the resource conforms. It is structural validation only, with no cluster contact, much like kubeconform.
Common usage
kubeval deployment.yaml
kubeval --strict --kubernetes-version 1.18.0 manifests/*.yaml
cat manifest.yaml | kubevalOptions
| Flag | What it does |
|---|---|
| --strict | Disallow additional properties (catch typos) |
| --kubernetes-version | Schema version to validate against |
| --ignore-missing-schemas | Skip kinds without a schema instead of failing |
| --skip-kinds | Comma-separated kinds to skip |
| -o, --output | Output format: stdout, json, tap |
Deprecation note
kubeval is archived and its schema set lags behind current Kubernetes releases, so newer apiVersions may report could not find schema. Migrate to kubeconform: the flags map closely (--strict to -strict, --kubernetes-version to -kubernetes-version), and it tracks current schemas and runs faster.
Common errors in CI
Failed initializing schema ... could not find schema for <Kind> is common on recent apiVersions because kubeval is unmaintained; this alone is a reason to switch to kubeconform. The document ... contains an invalid <Kind> lists the specific schema violation. --ignore-missing-schemas quiets missing-schema failures but hides genuinely unknown kinds.