How to Validate Kubernetes YAML Manifests
Validate your Kubernetes manifests against the official API schema to catch field errors, wrong API versions, and structural mistakes before deploying.
Tool Used
Kubernetes YAML Validator
Paste your Kubernetes manifest
Open the Kubernetes YAML Validator tool. Paste your Kubernetes manifest YAML into the input field. For multiple resources, separate them with --- on its own line. The validator supports all standard Kubernetes resource kinds: Deployment, Service, ConfigMap, Secret, Ingress, StatefulSet, DaemonSet, Job, CronJob, HorizontalPodAutoscaler, and more.
Select your target Kubernetes version
Use the version selector to choose the Kubernetes version your cluster runs. API availability varies by version — networking.k8s.io/v1beta1 for Ingress was removed in 1.22, for example. Selecting the correct cluster version ensures the validator checks API version compatibility in addition to schema validation.
Click Validate and read the results
Click Validate. If the manifest is valid, you see a success message for each resource. Errors appear with the full field path (e.g., spec.template.spec.containers[0].resources), the specific validation rule that failed, and a description of the problem. Fix each error and validate again until all errors are resolved.
Fix common structural errors
The most common errors are: wrong indentation causing fields to be nested under the wrong parent; selector and label mismatches (spec.selector.matchLabels must exactly match spec.template.metadata.labels in a Deployment); deprecated API versions (check the validator's suggestion for the current version); and missing required fields like metadata.name or spec.selector. YAML indentation errors often cause the most confusing validation failures — use a fixed-width editor and enable YAML syntax highlighting.
Add resource limits and health checks
After resolving schema errors, check the warnings. Most validators flag missing resource requests/limits and missing liveness/readiness probes. Add resources.requests and resources.limits to every container spec. Add a livenessProbe and readinessProbe using an HTTP endpoint, TCP check, or exec command. These are not schema errors but are critical for production reliability and cluster resource management.
All done!
You are ready to use Kubernetes YAML Validator like a pro.