Kubernetes v1.36 has moved validation for native API types to a declarative model, replacing thousands of lines of handwritten Go code with an automated generator. The new framework utilizes +k8s marker tags in Go struct definitions to enforce constraints, improving API consistency, maintainability, and programmatic discoverability.
Key points
Declarative validation replaces manual Go validation functions with automated code generation via `validation-gen`.
Using marker tags (`+k8s:`) allows validation rules to be defined directly alongside the type definitions in `types.go`.
This transition reduces technical debt by removing thousands of lines of boilerplate code and improving cross-resource consistency.
Declarative rules improve API transparency, enabling external tooling and clients to programmatically interpret validation constraints.