A document can be valid YAML and still be rejected by Kubernetes, Docker Compose, or a CI platform. Each layer answers a different question.
Syntax
Can a YAML parser read the document? This catches indentation, quoting, and malformed collection errors.
Schema
Are fields present, correctly typed, and allowed by the target specification?
Semantic rules
Do references, selectors, ports, dependencies, and policies make sense together?
Runtime or server dry-run
Will the real target accept the configuration with its installed CRDs, admission policies, and current state?
Key takeaways
- Formatting is not validation.
- Schema validity is not runtime acceptance.
- Run the cheapest checks first and the authoritative check last.