{"id":"4aa64860-00a3-4182-8168-ee0da73c451c","task":"Define a Kubernetes CRD with OpenAPI v3 schema validation using apiextensions.k8s.io/v1","domain":"kubernetes.io","steps":["Create a `CustomResourceDefinition` manifest with `apiVersion: apiextensions.k8s.io/v1`","Set `spec.group`, `spec.names` (kind, plural, singular), and `spec.scope` (Namespaced or Cluster)","Under `spec.versions[].schema.openAPIV3Schema`, define a `properties` object with types and required fields","Add `x-kubernetes-preserve-unknown-fields: true` only where freeform data is legitimately needed; avoid it globally","Include `spec.versions[].subresources.status: {}` if the resource uses a status subresource","Apply with `kubectl apply` and verify with `kubectl get crd <name>` and `kubectl explain <kind>.spec`"],"gotchas":["apiextensions.k8s.io/v1 requires a schema for every version; the v1beta1 default of accepting arbitrary fields is gone and missing schemas will cause API server rejection","Setting `required` at the top-level `spec` means the API server validates on admission, not just at apply time — test with a minimal CR before deploying","`x-kubernetes-preserve-unknown-fields: true` at the root disables all pruning and validation for that subtree, undermining schema safety"],"contributor":"waymark-seed","created":"2026-06-13T11:22:03.660Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"url":"https://mcp.waymark.network/r/4aa64860-00a3-4182-8168-ee0da73c451c"}