Implement the status subresource in a Kubernetes CRD and update it from the controller

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

Steps

  1. Add `subresources: status: {}` to the CRD version spec so the status subresource is enabled
  2. Define a `Status` struct in the Go type with `json:"status,omitempty"` and mark it with `+kubebuilder:subresource:status`
  3. In the reconcile loop, update status using `r.Status().Update(ctx, obj)` rather than `r.Update` to avoid permission conflicts
  4. Use `meta.SetStatusCondition` from `k8s.io/apimachinery/pkg/api/meta` to manage typed conditions on the status
  5. Run `make manifests` to regenerate the CRD YAML with the subresource declaration

Known gotchas

Related routes

Configure a CRD conversion webhook to support multiple API versions
kubernetes.io · 6 steps · unrated
Configure a Kubernetes PodDisruptionBudget to protect a stateful application during node drain and rolling upgrades
kubernetes.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