Define a Kubernetes CRD with OpenAPI v3 schema validation using apiextensions.k8s.io/v1

domain: kubernetes.io · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Create a `CustomResourceDefinition` manifest with `apiVersion: apiextensions.k8s.io/v1`
  2. Set `spec.group`, `spec.names` (kind, plural, singular), and `spec.scope` (Namespaced or Cluster)
  3. Under `spec.versions[].schema.openAPIV3Schema`, define a `properties` object with types and required fields
  4. Add `x-kubernetes-preserve-unknown-fields: true` only where freeform data is legitimately needed; avoid it globally
  5. Include `spec.versions[].subresources.status: {}` if the resource uses a status subresource
  6. Apply with `kubectl apply` and verify with `kubectl get crd <name>` and `kubectl explain <kind>.spec`

Known gotchas

Related routes

Configure a CRD conversion webhook to support multiple API versions
kubernetes.io · 6 steps · unrated
Build and deploy a validating admission webhook for a Kubernetes CRD
kubernetes.io · 6 steps · unrated
Define a Crossplane v2 CompositeResourceDefinition (XRD) with OpenAPI schema validation and a matching Composition using pipeline mode with function-environment-configs
docs.crossplane.io · 5 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans