Skip to content

Status and Conditions

Every Cloudflare-side resource this project manages reports its state through Kubernetes conditions — a small, fixed vocabulary repeated identically across every CRD, rather than each resource inventing its own status shape.

A single Ready flag can’t distinguish “your spec is wrong” from “your spec is fine but the last write to Cloudflare failed” from “the write succeeded but what it produced looks unhealthy” — three genuinely different problems with three different fixes. So most of this project’s Cloudflare-side resources report three independent conditions instead. (The exception is the policy-attachment CRDs, CloudflareTunnelPolicy and CloudflareAccessPolicy — a policy has no Cloudflare-side resource of its own to sync or check health on, so they carry Accepted only; see Conditions for the full breakdown.)

  • Accepted — is the spec itself valid and admissible?
  • Synced — did the last reconcile against the Cloudflare API succeed?
  • Ready — is the resulting Cloudflare-side resource actually healthy?

Accepted=True, Synced=True, Ready=False is a real state you’ll see in practice: the resource was written successfully, but what got written isn’t serving correctly yet (a tunnel with no active connectors, a certificate still issuing). Collapsing that into one Ready=False would throw away the distinction between “haven’t tried yet,” “tried and failed,” and “there, but unhealthy.”

See Conditions for the full Reason vocabulary behind these three condition types.

Gateway API types keep their own conditions

Section titled “Gateway API types keep their own conditions”

Gateway, HTTPRoute, GRPCRoute, and the rest of the Gateway API object set carry only Gateway API’s own standard conditions (Accepted, Programmed, ResolvedRefs, and so on). This project never adds a custom condition onto one of those types — it either writes those standard conditions itself, or doesn’t write to that object’s status at all, depending on mode.

Gateway.status is this project’s own: the controller that watches a Tunnel-mode Gateway writes its Accepted and Programmed conditions directly, and status.addresses carries the Cloudflare-generated hostname your traffic actually reaches. kubectl get gateway is a complete readiness picture on its own.

Every condition this project writes carries observedGeneration, set to the object’s metadata.generation at the time the condition was computed. Compare it against the object’s current metadata.generation to tell whether a condition reflects your latest edit or a stale one from before it: if observedGeneration is behind generation, the controller hasn’t reconciled your latest change yet, and the condition you’re looking at predates it.

One exception: CloudflareAccessApplication’s Ready condition is deliberately left untouched (not re-asserted) on a transient Cloudflare API failure, so a real reconcile can happen — bumping Accepted/Synced’s observedGeneration — while Ready’s observedGeneration stays behind. Don’t read a lagging Ready.observedGeneration on that kind as proof the controller hasn’t reconciled at all; check Accepted/Synced too.

Start with a plain kubectl get, which surfaces Ready (or Accepted, for policy CRDs) via a print column on most of this project’s CRDs:

Terminal window
kubectl get cloudflaretunnel my-tunnel

For the Reason and message behind that status, go through status.conditions directly:

Terminal window
kubectl get cloudflaretunnel my-tunnel \
-o jsonpath='{.status.conditions[?(@.type=="Ready")]}'

For CloudflareGatewayStatus, the same condition lives one level deeper, inside its single ancestors[] entry:

Terminal window
kubectl get cloudflaregatewaystatus my-gateway \
-o jsonpath='{.status.ancestors[0].conditions[?(@.type=="Ready")]}'

A policy CRD (CloudflareTunnelPolicy, CloudflareAccessPolicy) instead carries one ancestors[] entry per object it attaches to, each with an Accepted condition only — read the specific entry for the target you care about rather than a single fixed index.

kubectl describe surfaces Kubernetes Events, but most kinds don’t emit one on a condition transition — CloudflareTunnel (used in the example above) is one of them. Today only CloudflareTunnelPolicy and CloudflareAccessPolicy emit a Warning/Normal Event on every transition of their ancestor Accepted condition; a few other kinds emit Events for specific named situations, not as a general condition-transition mechanism. See Events for the fuller list, including the Event reasons that aren’t tied to a condition transition at all.

Conditions has the full Reason-by-Reason reference: what each one means, and what to do about it.