Back to Devoured - May 08, 2026
DEVOURED
Kubernetes v1.36: Declarative Validation Graduates to GA

Kubernetes v1.36: Declarative Validation Graduates to GA

DevOps Kubernetes
Kubernetes v1.36 has moved Declarative Validation for native types to General Availability, replacing thousands of lines of handwritten Go validation code with +k8s: marker tags for more consistent, maintainable, and self-documenting API constraint enforcement.
What: This GA feature uses a validation-gen code generator to parse +k8s: marker tags (e.g., +k8s:minimum=0, +k8s:required, +k8s:listType=map) placed in types.go files, automatically generating validation functions. This approach includes "ambient ratcheting," which allows tightening validation rules without breaking existing objects during updates.
Why it matters: This marks a significant architectural shift in Kubernetes API development, reducing technical debt and inconsistency while paving the way for better programmatic understanding of validation rules, improving tooling, and streamlining API reviews for contributors.
Takeaway: If you contribute to Kubernetes or develop tools that interact deeply with its API, familiarize yourself with the new +k8s: validation tags, as they are now the primary mechanism for new validation rules and will be adopted for existing APIs.
Decoder
  • Declarative Validation: A method of defining validation rules using structured metadata (like +k8s: marker tags) directly within the API type definitions, rather than in separate code.
  • validation-gen: A code generator used in Kubernetes that parses declarative validation marker tags and automatically produces the corresponding Go validation functions.
  • +k8s: marker tags: Special comments embedded in Go source code that provide metadata for code generators, now used to define validation rules like +k8s:minimum or +k8s:required.
  • Ambient Ratcheting: A built-in safety mechanism in the declarative validation framework that allows new, stricter validation rules to be applied without breaking existing objects, by bypassing the new rule if a field's value is semantically equivalent to its prior state during an update.
  • kube-api-linter: A tool that statically analyzes Kubernetes API types and enforces API conventions, now empowered by declarative validation to automatically check rules.
  • OpenAPI schemas: Machine-readable specifications of APIs that describe their structure, endpoints, and validation rules; declarative validation makes it possible to reflect these rules in OpenAPI.
  • Custom Resource Definitions (CRDs): Kubernetes API extensions that allow users to define their own custom resources, which can now leverage the same declarative validation framework through tools like Kubebuilder.
Original article

Kubernetes v1.36 introduced Declarative Validation for native types as a generally available feature, replacing thousands of lines of handwritten Go validation code with automated marker tags that make API constraints self-documenting and easier to maintain.

Explore all 68 articles in today's digest

Fresh dev news, AI-digested daily. Never miss a trend at devoured.fyi