Operations
This page covers the operational side of running this controller once it’s installed: upgrading it safely, what to watch once it’s live, how to read the common failure symptoms, and how to take it out of a cluster cleanly.
Upgrade
Section titled “Upgrade”-
Read the release notes for the version you’re moving to. Past releases have added new CRDs — v0.2.0 added the tunnel-policy CRD, and v0.3.0 added the four Access CRDs — so the step below isn’t boilerplate; it’s the step that actually matters most releases.
-
Apply the new chart’s CRDs before touching the release itself. Helm’s own behavior is the reason this is a separate step:
helm upgradenever installs or updates CRDs, on any release, even when the chart’scrds/directory changed. Pull the target version’s CRDs and apply them server-side —--server-sideis good practice here regardless (it tracks field ownership instead of relying on a client-side diff):Terminal window helm show crds oci://ghcr.io/dreamfuse-labs/charts/cloudflare-gateway-controller --version 0.4.0 \| kubectl apply --server-side -f -This exact command is verified against an additive CRD change (0.2.0 → 0.3.0, which only added new CRDs). A release that instead changes a field on an existing CRD can hit a server-side-apply ownership conflict, because Helm’s own
helm upgrade/helm installpath already owns those fields under thehelmfield manager. If you see a conflict error, add--force-conflictsto the command above — taking ownership of the changed fields is expected and correct in this situation. -
Then upgrade the release:
Terminal window helm upgrade cloudflare-gateway-controller oci://ghcr.io/dreamfuse-labs/charts/cloudflare-gateway-controller --version 0.4.0 --namespace cloudflare-gateway-controller-system -
Verify. Wait for the rollout, then confirm the objects that depend on this controller’s watches are still
Accepted:Terminal window kubectl rollout status deployment/cloudflare-gateway-controller -n cloudflare-gateway-controller-systemkubectl get gatewayclass -o custom-columns=NAME:.metadata.name,ACCEPTED:.status.conditions[0].statuskubectl get cloudflaregatewayconfiguration -o custom-columns=NAME:.metadata.name,ACCEPTED:.status.conditions[0].status
If you skip step 2 on a release that added a CRD: at process startup, before it starts reconciling anything, this controller registers a watch for every custom resource kind it reconciles, including the newly added ones. If the cluster doesn’t have that kind registered yet, the failure mode depends on what that controller’s setup does:
- If setting it up also registers a field index for that kind (two controllers do this
today: one indexes
CloudflareTunnelPolicyby its target, the otherCloudflareAccessIdentityProviderby its referenced Secret) — the index registration needs an immediate type lookup, which fails synchronously, right there inSetupWithManager. The process exits immediately, before the manager even starts. - Otherwise, the plain watch itself doesn’t fail at setup time —
controller-runtimeretries the type lookup every 10 seconds in the background. The process instead runs for a while (up to the cache-sync timeout, 2 minutes by default) before that watch’s cache fails to sync andmgr.Startgives up.
Either way, the whole controller exits — not degraded, not partially working, not failing
only the first time something touches the new feature — and the Pod sits in
CrashLoopBackOff until the missing CRD is applied. Nothing is silently skipped; the process
simply refuses to stay up. Applying the CRDs (even after the fact, without re-running
helm upgrade) is enough on its own to let the next restart succeed.
Upgrading to v0.4.0, which adds tunnel autoscaling and image overrides
Section titled “Upgrading to v0.4.0, which adds tunnel autoscaling and image overrides”Three things in this release affect every installation, whether or not you turn the new features on.
- Every existing tunnel rolls once. The release gives each managed
cloudflaredcontainer resource settings, which changes the pod template, so each tunnel’s Deployment rolls once afterhelm upgrade. A rollout at the default 2 replicas dropped no requests when tested at about 5 requests per second. A tunnel running a single replica was not tested and may briefly drop requests during the roll. - Every
cloudflaredcontainer now has a memory limit, and this release has no setting to change it. The settings are a 100m CPU request, a 64Mi memory request and a 128Mi memory limit, with no CPU limit. In testing with one client,cloudflaredpeaked at about 53Mi. A tunnel carrying many concurrent WebSocket or streaming connections was not measured, and Kubernetes kills and restarts a container that exceeds its memory limit. After upgrading, check for restarts:kubectl get pods -A -l app.kubernetes.io/name=cloudflared. - Step 2 matters for the new fields. This release adds optional fields to the
CloudflareGatewayConfigurationandCloudflareTunnelPolicyCRDs. If the CRDs are not applied first, the API server accepts the object and discards the fields it does not know, so nothing fails and no autoscaler or pull-secret setting ever takes effect. Unlike a missing CRD kind, this does not crash the controller, so nothing alerts you.
Observability
Section titled “Observability”Metrics
Section titled “Metrics”The metrics endpoint’s address and authentication are chart values —
metrics.bindAddress/metrics.secure and the RBAC metrics.secure: true requires are already
covered in Helm Values; this page doesn’t repeat them. The same
reference also covers metrics.serviceMonitor.*, the optional Prometheus Operator
ServiceMonitor this chart can render for you.
Once the endpoint is reachable, four series are this project’s own, beyond anything
controller-runtime registers for free — each a gauge keyed by namespace/name, and each
deleted (not just zeroed) once its owning object is gone, so a fleet’s dashboard never
accumulates permanent series for objects that no longer exist:
| Series | Reports |
|---|---|
cloudflaretunnel_ready |
Whether a CloudflareTunnel’s Ready condition is currently True (1) or False (0). |
cloudflaretunnel_connector_count |
How many cloudflared connector connections are currently reported for a CloudflareTunnel. |
cloudflarednsrecord_synced |
Whether a CloudflareDNSRecord’s Synced condition is currently True (1) or False (0). |
dns_gateway_ready |
Whether a DNS-mode Gateway’s derived Cloudflare-side readiness (DNS record sync plus certificate readiness, reported through its owned CloudflareGatewayStatus) is currently True (1) or False (0), keyed by the Gateway’s own namespace/name. |
Two more series cover the Cloudflare API calls this controller makes on your behalf, not the Kubernetes-side resources those calls produce:
cloudflare_api_request_duration_seconds(a histogram) — latency of every Cloudflare API request, labeledmethod(the HTTP verb),path(the request path, with any zone/tunnel/ record ID collapsed to a fixed placeholder so the series stays low-cardinality regardless of how many distinct Cloudflare resources a credential ever touches), andstatus(2xx,4xx,5xx, orerrorfor a request that never got a response at all).cloudflare_api_rate_limit_hits_total(a counter) — how many Cloudflare API responses came back429 Too Many Requests, labeledmethodandpath(same collapsing as above). See RateLimited below for what a hit on this counter means for a specific object.
Beyond these, controller-runtime’s own standard series are already there for free — reconcile counts, reconcile duration, and workqueue depth per controller — the same series any controller-runtime-based project exposes. This page doesn’t re-document those; they’re not specific to this project.
Health probes
Section titled “Health probes”The controller exposes the usual two: /healthz (process liveness) and /readyz, which
reports ready only once every informer cache it depends on has finished its initial sync —
not merely “the process is alive.” Both bind to healthProbeBindAddress (a chart value,
:8081 by default).
Structured JSON by default — the shipped image’s deliberate production default, so logs are
straightforward to ship into a log aggregator without a separate parsing step. The chart does
not expose a value for passing extra controller arguments today, so there’s no supported way
to switch to a human-readable console format (--zap-devel=true) without either patching the
chart’s Deployment template directly or applying a Helm post-renderer — not something worth
doing for a running deployment; reach for kubectl logs | jq instead if you need to read JSON
output by eye.
Troubleshooting
Section titled “Troubleshooting”Every condition below links to its full entry in Conditions, which covers every Reason this project ever sets, not just the ones that show up here.
InvalidZone
Section titled “InvalidZone”Symptom: an object (a CloudflareDNSRecord, CloudflareAccessApplication, or similar)
never reaches Accepted. Condition: Accepted=False, Reason=
InvalidZone. Fix: the zone the object targets isn’t
in its resolved CloudflareGatewayConfiguration’s zoneAllowlist — add the zone there, or
point the object at a configuration that already allows it.
InvalidParameters
Section titled “InvalidParameters”Symptom: a GatewayClass or another object never reaches Accepted. Condition:
Accepted=False, Reason=
InvalidParameters. Fix: depends on what the
message names — usually a parametersRef/configurationRef that doesn’t resolve, or
resolves to something not itself Accepted.
One specific shape of this is expected, not a problem to fix by hand: a GatewayClass
applied before the CloudflareGatewayConfiguration its parametersRef names even exists.
The GatewayClass reports InvalidParameters immediately (the reference can’t resolve yet),
but this controller watches every CloudflareGatewayConfiguration for exactly this reason
(v0.3.0 and later — on an earlier version, restart the controller to force re-evaluation
instead) — once the configuration is created and itself becomes Accepted, the
GatewayClass is automatically re-evaluated and flips to Accepted with no further action.
Give it a few seconds after creating the configuration before assuming something is actually
stuck; if it’s still InvalidParameters after the configuration itself reports
Accepted=True, re-check the parametersRef’s group/kind/name for a typo instead.
A GRPCRoute returns 403 from Cloudflare’s edge, never reaching your backend at all
Section titled “A GRPCRoute returns 403 from Cloudflare’s edge, never reaching your backend at all”This is a zone-level setting, not a routing bug — see the third requirement in Routing’s GRPCRoute section for the full explanation (the zone’s gRPC network feature has to be turned on at Cloudflare before any gRPC traffic reaches your tunnel). This page doesn’t repeat it.
A Certificate is never created for a listener that needs one
Section titled “A Certificate is never created for a listener that needs one”Symptom: a listener needing an ACME-managed certificate never gets a cert-manager
Certificate object at all — not pending, not failing, simply absent. Cause: this
controller only checks once, at its own startup, whether cert-manager’s Certificate CRD is
registered — see Install’s Prerequisites for the full
detail and the exact kubectl rollout restart fix. If cert-manager was installed after the
controller, this is almost certainly it.
A proxied: true record reaches Accepted but never Synced
Section titled “A proxied: true record reaches Accepted but never Synced”Symptom: a CloudflareDNSRecord with proxied: true stays Accepted=True indefinitely
without ever reaching Synced=True, no matter how long you wait. Condition:
Synced=False, Reason=CloudflareAPIError,
with Cloudflare’s own “not allowed for a proxied record” text (error 9003) in the message.
Cause: confirmed against this project’s own end-to-end run — Cloudflare’s API refuses
outright to create a proxied record targeting a private IP address, and a local
LoadBalancer address (kind plus MetalLB, or Docker Desktop’s networking generally) is always
private. See the proxied vs DNS-only
section of the DNS Mode quickstart for the full explanation. Fix: there isn’t one on a
local cluster — a proxied record needs a genuinely public-routable origin address. Use
proxied: false locally, and reserve proxied: true for a cluster with a real cloud
LoadBalancer.
curl hangs against a hostname that’s actually working
Section titled “curl hangs against a hostname that’s actually working”Specific to a local kind cluster running under Docker Desktop (macOS/Windows) — see the
Docker Desktop callout in the DNS Mode quickstart’s verification step
for why, and the docker exec curl workaround. Not an issue on a real cloud cluster.
RateLimited
Section titled “RateLimited”Symptom: a CloudflareTunnel, CloudflareDNSRecord, CloudflareAccessApplication, or
CloudflareAccessIdentityProvider’s Synced condition (or a DNS-mode CloudflareGatewayStatus’s
ancestor status) flips to False with Reason=
RateLimited, usually across several objects sharing one
credential at once. Fix: nothing to do by hand — the
controller already retries with backoff, and the condition clears once the rate-limit window
passes. cloudflare_api_rate_limit_hits_total (above) is the metric to watch if this recurs
often enough to be worth investigating credential sharing across tenants.
Uninstall
Section titled “Uninstall”-
Delete every
Route,Gateway, and this project’s own custom resource that carries a finalizer first — while the controller is still running — but not yet yourCloudflareGatewayConfigurationobjects (step 3 below handles those separately, and later). This order matters: deleting these objects only starts their cleanup. The actual Cloudflare-side deletes (and the ownership-marker checks that guard them) happen in each object’s finalizer, which needs a live controller process to run at all. Uninstalling the chart first would leave every one of those objects stuckTerminatingforever, with its finalizer never removed and its real Cloudflare-side resource never cleaned up. -
Wait for the finalizers to actually clear before moving on — every kind listed below carries a finalizer; leaving one out of this wait risks moving to step 3 before its cleanup has run, which (per that step’s own note) can orphan its Cloudflare-side resource:
Terminal window kubectl wait --for=delete cloudflaretunnel,cloudflarednsrecord,cloudflareaccessapplication,cloudflareaccessidentityprovider,cloudflareaccessservicetoken,cloudflareaccesspolicy --all --all-namespaces --timeout=120s -
Delete your
CloudflareGatewayConfigurationobjects. Do this after step 2, not before — an object whose finalizer runs after its configuration is already gone has no credential left to authenticate a Cloudflare-side delete with. -
Uninstall the chart:
Terminal window helm uninstall cloudflare-gateway-controller --namespace cloudflare-gateway-controller-system -
The CRDs stay behind. This is the same Helm behavior that makes step 2 of Upgrade necessary in the first place: Helm never deletes CRDs on
helm uninstalleither. Leaving them is usually what you want — any remaining custom resources of these kinds (on a multi-tenant cluster, possibly belonging to a different release) stay intact. Deleting them is optional, and genuinely destructive: a CRD delete cascades to every instance of that kind across the entire cluster, not just the ones this release created. Only do this on a cluster where you’re certain nothing else depends on these kinds:Terminal window kubectl get crd -o name | grep cfgateway.dreamfuselabs.com | xargs kubectl delete -
Check for anything orphaned on the Cloudflare side. If step 1 was skipped, or a finalizer was force-removed while the real Cloudflare-side resource still existed, nothing in Kubernetes will tell you that resource is still there — it has no Kubernetes object left to report it. There’s no automated check for this; look in the Cloudflare dashboard for a tunnel, DNS record, or Access application still carrying this project’s ownership marker (see Ownership markers for what that marker looks like for each kind) with no corresponding cluster left to manage it, and remove it by hand if you find one.