Skip to content
GitHub

Flareway API reference

This page covers every Kind in flareway.bhyoo.com/v1alpha1, such as CloudflareTunnel and AccessApplication. The generated CRDs remain authoritative.

The CRDs in config/crd/bases/ define validation, defaults, limits, and status schemas.

  • Enum values use the spelling defined by the CRD schema. Lifecycle and discriminator enums are generally PascalCase; ZeroTrustGatewayPolicy, ZeroTrustList, and some device-profile fields retain Cloudflare’s wire-native spelling.
  • Resources that call Cloudflare require spec.accountRef.name.
  • managementPolicy is Managed or ObserveOnly.
  • adoption.mode is None or AdoptById. AdoptById requires an externalRef; matching a remote name is never enough.
  • deletionPolicy is Delete or Orphan (DeviceSettings and ZeroTrustOrganization singletons permit only Orphan).
  • A namespaced object reference contains name and an optional namespace; an omitted namespace means the referencing object’s namespace.
  • Secret values are accepted only through Secret references or written to controller-owned Secrets. Status never contains API tokens, client secrets, passwords, bearer tokens, Tunnel tokens, WARP Connector tokens, or Access AUDs.

Kinds by area:

Area Kinds
Gateway and account GatewayClassConfig, CloudflareAccount, CloudflareTunnel
Access applications AccessApplication, AccessStandaloneApplication
Access dependencies AccessPolicy, AccessGroup, IdentityProvider, AccessCustomPage, DevicePostureRule, DevicePostureIntegration, AccessInfrastructureTarget, ServiceToken
Private network VirtualNetwork, NetworkRoute, HostnameRoute, WARPConnector
Device and organization DeviceProfile, DeviceSettings, ZeroTrustOrganization, ZeroTrustGatewayPolicy, ZeroTrustList
Flareway version Gateway API Standard CRDs Kubernetes API / client-go Envoy data plane cloudflared connector
v0.4.0 - v0.5.0 v1.7.0 (backward-compatible with v1.6.x) v1.37 (client-go v0.37.1) distroless-v1.40.0 2026.10.2
v0.3.3 v1.6.3 v1.37 (client-go v0.37.1) distroless-v1.39.3 2026.10.0
v0.1.0 - v0.3.1 v1.6.2 v1.37 (client-go v0.37.0) distroless-v1.39.0 2026.9.0

A Flareway controller built for Gateway API v1.7.0 remains backward-compatible with clusters running Gateway API v1.6.x Standard CRDs for all v1.6.x resources and fields. Gateway API v1.7.0 Standard CRD features such as HTTPRoute.spec.rules[].retry require the v1.7.0 CRDs installed on the cluster.

GatewayClassConfig is cluster-scoped and is referenced by a Gateway API GatewayClass.parametersRef. spec.accountRef is required in Cloudflare mode and must be omitted when conformanceMode: true.

The resource owns class defaults for the cloudflared connector, Envoy proxy, private-DNS sidecar, managed or external DNS, origin JWT mode, the Gateway-safe originRequest subset, and dataplane pod scheduling. Conformance mode instead selects the direct data-plane Service type and performs no Cloudflare account operations.

spec.scheduling places the dataplane pods of every Gateway in the class. It is class-level only: CloudflareTunnel has no scheduling override, so per-Gateway placement requires a separate GatewayClass and GatewayClassConfig.

Field Effect
nodeSelector Copied verbatim to the pod spec; at most 64 entries.
tolerations Copied verbatim; at most 16 entries.
affinity Copied verbatim except for the default pod anti-affinity below.
topologySpreadConstraints Copied verbatim; at most 8 entries, deduplicated on (topologyKey, whenUnsatisfiable).

Unless affinity.podAntiAffinity is set, Flareway adds one soft anti-affinity term so replicas prefer distinct nodes:

podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
topologyKey: kubernetes.io/hostname
labelSelector:
matchLabels:
app.kubernetes.io/name: flareway-gateway
flareway.bhyoo.com/gateway: <namespace>--<gateway-name>
matchLabelKeys: [pod-template-hash]

matchLabelKeys narrows the term to the current ReplicaSet revision, so a rollout surge pod is not repelled by the previous revision’s pods. A user-supplied podAntiAffinity replaces the default entirely — it is not merged. Setting affinity.podAntiAffinity: {} opts out of the default; affinity: {}, affinity: null, and podAntiAffinity: null do not opt out. Flareway adds no default topologySpreadConstraints: any pod-level entry disables the scheduler’s cluster default constraints, so the field stays absent unless configured.

Soft rules (preferredDuringScheduling…, ScheduleAnyway) are best effort: they are evaluated only at scheduling time, never make a node infeasible, and are not rebalanced afterwards. Spread improves resilience within the selected topology domain; it is not a guarantee against simultaneous failures inside or outside that domain. Hard rules (requiredDuringScheduling…, DoNotSchedule) can stall a rollout: the dataplane Deployment uses maxUnavailable: 0, so when no node qualifies the surge pod stays Pending and the rollout cannot converge. On large clusters, inter-pod affinity scoring adds scheduler work proportional to pods per node; affinity.podAntiAffinity: {} opts out where scheduling latency matters more than spread.

The CRD validates toleration operator/effect combinations, tolerationSeconds requiring NoExecute, maxSkew > 0, whenUnsatisfiable (DoNotSchedule or ScheduleAnyway), minDomains requiring DoNotSchedule, nodeAffinityPolicy/nodeTaintsPolicy values, matchLabelKeys requiring a labelSelector without matchLabels overlap, at least one nodeSelectorTerm in required node affinity, preferred-term weights in 1–100, and non-empty pod affinity topologyKeys. Two intentional divergences from the Pod API: Lt/Gt toleration operators are rejected, and whenUnsatisfiable is required even though the Pod API defaults it to DoNotSchedule.

Label syntax (nodeSelector keys and values, toleration keys and values, selector internals), namespaces format, node selector requirement operator/value cardinality, and pod affinity topologyKey syntax are deferred to Deployment admission — the CRD can accept a spec that the dataplane Deployment then rejects. An Invalid, Forbidden, or BadRequest rejection of a Gateway-owned dataplane mutation sets Gateway and listener Programmed=False with reason Invalid and emits a DataplaneApplyRejected Warning Event identifying the object and rejection category. Identical retries do not repeat the Event. The controller keeps retrying without tearing down existing workloads; transient errors and observation failures do not trigger this rejection status. After the configuration is corrected, the normal programming gates must converge before Programmed=True is restored.

Flareway owns one PodDisruptionBudget per Gateway dataplane, derived from the effective connector replicas (class default 2; a Gateway-mode CloudflareTunnel.spec.connector.replicas overrides it per Gateway). The controller updates the same PDB in place when replicas changes; the object is not recreated.

  • replicas of 2 or more: minAvailable: 1 with unhealthyPodEvictionPolicy unset, keeping the default IfHealthyBudget. Voluntary eviction keeps at least one dataplane Pod available. The budget stays minAvailable-based; it does not switch to maxUnavailable.
  • replicas: 1: minAvailable: 0 with unhealthyPodEvictionPolicy: AlwaysAllow. A singleton has no redundant Pod to keep available, so the budget permits voluntary eviction of the only Pod — healthy or NotReady — instead of the PDB blocking the drain. Evicting it takes the data plane down; that downtime is unavoidable at one replica.

Replica transitions converge rather than switch atomically: the Deployment and PDB updates apply sequentially and status.disruptionsAllowed is recomputed asynchronously, so the previous eviction behavior can persist briefly. Scaling the Deployment to zero is unaffected — the ReplicaSet controller terminates Pods directly without the Eviction API.

CloudflareAccount is cluster-scoped and defines the credential and tenant boundary:

apiVersion: flareway.bhyoo.com/v1alpha1
kind: CloudflareAccount
metadata:
name: production
spec:
accountId: "0123456789abcdef0123456789abcdef"
credentials:
apiTokenSecretRef:
name: cloudflare-api
namespace: flareway-system
key: token
grants:
- namespaceSelector:
matchLabels:
flareway.bhyoo.com/tenant: payments
hostnames: ["*.example.com"]
zones: ["example.com"]
exposures: [Public, Private]
unprotectedHostnames: ["health.example.com"]
accessPolicyRefs: Allowed
accessCustomPageRefs: Allowed
devicePostureIntegrationRefs: Allowed
accessStandaloneApplicationRefs: Allowed
privateRoutes:
networkRouteSelector: {}
hostnameRouteSelector: {}
backends:
namespaces: Same
kinds: [Service]
platformObjects: Denied
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: flareway-platform
hostnames: ["app.example.com", "ssh.example.com"]
zones: ["example.com"]
exposures: [Public, Private]
unprotectedHostnames: ["app.example.com", "ssh.example.com"]
privateRoutes:
networkRouteSelector: {}
hostnameRouteSelector: {}
platformObjects: Allowed

A matching grant is required before a controller reads a referenced Secret or calls Cloudflare. Grants independently authorize hostname, DNS zone, listener exposure, reusable policy references, custom pages, posture integrations, standalone applications, private routes, platform objects, and Kubernetes backends.

Access applications and service tokens use the account endpoint when spec.zone is omitted. When zone is present, Flareway resolves its exact DNS name through CloudflareAccount.status.verified.zones; users do not place a zone ID in this field.

Cloudflare application types are split by Kubernetes ownership model.

Kind spec.type values
AccessApplication SelfHosted, SSH, VNC, RDP, MCP, ProxyEndpoint
AccessStandaloneApplication SaaS, Bookmark, Infrastructure, AppLauncher, WARP, BISO, DashSSO, MCPPortal

Both Kinds require accountRef, immutable type, and exactly one variant matching the type.

AccessApplication is a GEP-713 Direct policy attached to Gateway API targets.

apiVersion: flareway.bhyoo.com/v1alpha1
kind: AccessApplication
metadata:
name: admin
namespace: payments
spec:
accountRef: {name: production}
zone: example.com
type: SelfHosted
selfHosted: {}
targetRefs:
- group: gateway.networking.k8s.io
kind: HTTPRoute
name: admin
sectionName: admin-rule
pathScope:
type: PathPrefix
value: /admin
application:
name: payments-admin
sessionDuration: 8h
allowAuthenticateViaWarp: true
autoRedirectToIdentity: true
allowedIdpRefs:
- externalId: "00000000-0000-0000-0000-000000000001"
customPageRefs:
- objectRef:
name: access-denied
namespace: flareway-platform
serviceAuth401Redirect: true
policies:
- policyRef:
name: employees
namespace: flareway-platform
originJWT:
mode: Required
audienceScope: Application
bypass:
children:
- hostname: admin.example.com
path: /admin/healthz
externalRef: {applicationId: "existing-child-id"}
adoption:
mode: AdoptById
expect: {name: existing-health-bypass}
deletionPolicy: Orphan
managementPolicy: Managed
deletionPolicy: Delete

targetRefs[] accepts same-namespace gateway.networking.k8s.io Gateway and HTTPRoute objects. sectionName selects a Gateway listener or named HTTPRoute rule. Public destinations are always compiled from these targets; the deprecated Cloudflare self_hosted_domains field is not exposed.

pathScope requires at least one target. It narrows the target-derived hostname to an Exact or PathPrefix path; omitted type defaults to PathPrefix. It creates a more-specific protection domain without changing the HTTPRoute’s backend behavior.

ProxyEndpoint requires target references and does not accept direct destinations. Other attached application types require targets, destinations, or both.

destinations[] is a discriminated union. Each item requires type and exactly one matching member.

type Matching member Fields
Private private exactly one of networkRouteRef or hostnameRouteRef; optional cidr, portRange, `l4Protocol: TCP
ViaMCPServerPortal viaMcpServerPortal mcpServerId
Worker worker workerId
PreviewWorker previewWorker workerId
AllWorkers allWorkers {}
AllPreviewWorkers allPreviewWorkers {}
spec:
destinations:
- type: Private
private:
networkRouteRef: {name: payments-cidr}
cidr: 10.40.8.12/32
portRange: "5432"
l4Protocol: TCP
- type: Worker
worker: {workerId: "worker-id"}

The referenced route must cover the private destination. networkRouteRef and hostnameRouteRef name a route in the application’s own namespace. The matching account grant must authorize the application namespace for that route kind and labels. The route’s allowedNamespaces is evaluated against that same namespace: Same and All always admit it, and Selector admits it only when the namespace labels match.

  • SelfHosted, SSH, VNC, and MCP use marker objects.
  • RDP requires rdp.targetCriteria[]; every criterion uses protocol: RDP with port and non-empty targetAttributes.
  • ProxyEndpoint uses proxyEndpoint: {} and target references only.

originJWT.mode is Required by default; Disabled requires platform authorization. audienceScope defaults to Application:

  • Application accepts only this application’s AUD.
  • Hostname accepts every ready application AUD for the compiled hostname and requires mode: Required.

Private listeners use Envoy JWT validation. When Gateway TLS decryption cannot be observed, assumeGatewayTLSDecryption: true records the platform’s assertion; without proof or assertion, Flareway remains fail-closed.

Flareway creates more-specific self-hosted child applications for public paths carved out below a protected parent. status.bypassApplications[] records each child and whether it was Created, Recovered, or Adopted.

To adopt a child, declare its normalized hostname and path, externalRef.applicationId, adoption.mode: AdoptById, and expected attributes. An ObserveOnly parent requires an external reference for every child. This preserves existing child IDs and AUDs during migration.

The application block is shared by attached and standalone applications. It covers:

  • name, sessionDuration, allowAuthenticateViaWarp, allowIframe, skipInterstitial;
  • autoRedirectToIdentity, allowedIdpRefs, appLauncherVisible;
  • serviceAuth401Redirect, binding/HTTP-only/SameSite/path cookie settings;
  • optionsPreflightBypass or corsHeaders;
  • readServiceTokensFromHeader, custom deny message and URLs;
  • customPageRefs, eagerRedirectCookieSetting, logoUrl;
  • application MFA and OAuth authorization-server settings;
  • outbound scimConfig;
  • useClientlessIsolationAppLauncherUrl and user tags.

AccessStandaloneApplication type WARP is the exception: application.name is unsupported because Cloudflare owns the enrollment application’s name. To adopt an existing enrollment, identify it with externalRef.applicationId, adoption.mode: AdoptById, and a non-empty adoption.expect.name.

optionsPreflightBypass: true and corsHeaders cannot be set together. autoRedirectToIdentity: true requires exactly one allowedIdpRef.

SCIM authentication is one of HTTPBasic, OAuthBearerToken, OAuth2, AccessServiceToken, or an ordered multiple list. Passwords, bearer tokens, and OAuth client secrets are Secret key references. AccessServiceToken refers to a managed ServiceToken. scimConfig also exposes idpRef, remoteUri, deactivateOnDelete, enabled, and ordered mappings with schema, enabled, filter, create/update/delete operations, Strict|Passthrough, and transformJsonata.

Standalone applications use the same lifecycle, application settings, policy references, account/zone scope, and adoption model without Gateway targets.

apiVersion: flareway.bhyoo.com/v1alpha1
kind: AccessStandaloneApplication
metadata:
name: device-enrollment
namespace: flareway-platform
spec:
accountRef: {name: production}
type: WARP
application: {}
warp: {}
policies:
- policyRef: {name: managed-devices}
managementPolicy: Managed
deletionPolicy: Orphan

Variant fields:

type Variant contract
SaaS `saas.authType: OIDC
Bookmark bookmark.url, optional logoUrl
Infrastructure SSH targetCriteria, optional MFA, and inline Allow policies with SSH connection rules
AppLauncher colors, logo, landing-page design, footer links, login-page behavior
WARP warp: {} device-enrollment application
BISO biso: {} Browser Isolation permissions application
DashSSO dashSso.domain
MCPPortal mcpPortal.domain and typed destinations[]

SaaS OIDC supports grant types AuthorizationCode, AuthorizationCodeWithPKCE, RefreshTokens, Hybrid, and Implicit; scopes are OpenID, Groups, Email, and Profile. SaaS SAML supports typed NameID and attribute formats. A create-only SaaS client secret is written to a controller-owned Secret referenced by status.saas.clientSecretRef and is never copied into status.

AccessPolicy.decision is Allow, Deny, NonIdentity, or Bypass. include is required; require and exclude are optional. AccessGroup uses the same complete typed rule union and may nest groups through a group reference.

Policy attachments select either a managed policyRef or externalRef.policyId. Slice order defines remote precedence.

IdentityProvider.type values are OneTimePIN, AzureAD, SAML, Centrify, Facebook, GitHub, GoogleApps, Google, LinkedIn, OIDC, Okta, OneLogin, PingOne, Yandex, and Cloudflare.

Provider credentials use config.clientSecretRef. scimConfig can enable directory synchronization, configure identity-update and deprovision behavior, and reference the controller-owned SCIM Secret. Status may contain bounded users, groups, and public SAML certificates, but never credentials.

scimConfig.secretRef becomes immutable after it is set. Flareway reserves that Secret before enabling SCIM and uses an ownership-bound journal to recover ambiguous Cloudflare create responses without creating a second provider. To move the credential, replace the IdentityProvider through an explicit migration instead of changing the reference in place.

apiVersion: flareway.bhyoo.com/v1alpha1
kind: ServiceToken
metadata:
name: deployment-client
namespace: flareway-platform
spec:
accountRef: {name: production}
name: deployment-client
enabled: true
duration: 8760h
secretRef: {name: deployment-client}
rotation:
mode: Manual
graceDuration: 24h
deletionPolicy: Delete

The Secret uses CF-Access-Client-Id and CF-Access-Client-Secret. During a grace period it can also contain CF-Access-Client-Id-Previous and CF-Access-Client-Secret-Previous. rotation.requestedAt requests a manual rotation. OnExpiry refresh is account-scoped.

AccessCustomPage.type is IdentityDenied, Forbidden, Login, or Interstitial. html contains the HTML/Liquid template; contractVersion selects Cloudflare’s sanitized template contract.

DevicePostureIntegration.type is WorkspaceOne, CrowdstrikeS2S, Uptycs, Intune, Kolide, TaniumS2S, SentinelOneS2S, or CustomS2S. Provider-specific URLs and IDs are plain fields; keys and client credentials use Secret key references.

DevicePostureRule owns one reusable posture check. type selects the typed input contract for file, application, WARP, firewall, OS, certificate, antivirus, serial-number, domain-joined, and supported integration-backed checks. Integration-backed types require input.integrationRef; Firewall, CustomS2S, and ClientCertificateV2 enforce their type-specific required fields in the CRD schema. The resource also exposes platform matches, scheduling, expiration, explicit adoption, and deletion policy.

AccessInfrastructureTarget registers a hostname with IPv4, IPv6, or both. Each address chooses a namespaced virtualNetworkRef or an external virtualNetworkId, not both.

DeviceProfile is the aggregate writer for one Cloudflare device profile. profile.kind is Default or Custom; custom profiles require match, precedence, and fields.name, while the default profile cannot use externalRef or adoption. splitTunnel.mode is Include or Exclude and owns the complete static list plus selected NetworkRoute, HostnameRoute, private-hostname-range, and public AccessApplication sources. The same resource owns fallback domains, DNS search suffixes, service mode, tunnel protocol, virtual-network access, and the remaining mutable profile fields.

DeviceSettings is a namespaced account singleton and must be named default. It manages Gateway proxy, UDP proxy, root-certificate installation, Zero Trust virtual IP, and disable-duration settings. Its default managementPolicy is ObserveOnly; status reports observed values and the exact non-secret changes Managed mode would apply. Cloudflare exposes no device-settings delete operation, so deletionPolicy is always Orphan.

CloudflareTunnel.spec.configuration.mode defaults to Gateway. The Gateway controller owns the complete Cloudflare configuration and may use these Gateway-mode overrides:

  • connector: image, replicas, Auto|QUIC|HTTP2, grace period, resources;
  • proxy: image, resources, stream idle timeout, concurrency;
  • privateDNS: image and resources;
  • originRequest: connectTimeout, keepAliveTimeout, tcpKeepAlive, keepAliveConnections, noHappyEyeballs, disableChunkedEncoding, and http2Origin, the subset valid for a loopback Envoy origin; connectTimeout, keepAliveTimeout, and tcpKeepAlive must be non-negative and use whole-second precision;
  • listeners[]: listener name, Public|Private, optional virtual network, automatic hostname-route creation;
  • dns and optional managementToken.resources: [Logs].

Dataplane pod placement is not a tunnel override. It is configured at class level through GatewayClassConfig.spec.scheduling.

Gateway ownership is sticky and bound to both status.gatewayRef.name and status.gatewayUid. A later Gateway cannot preempt the live owner. Flareway drains the previous owner’s connector before admitting a successor. ObserveOnly Tunnels never issue connector tokens or create connector Secrets, and a non-empty status.deletedAt blocks Gateway publication, addresses, private routing, and configuration writes while cleanup drains the data plane.

Invalid top-level Gateway specs (spec.addresses, spec.allowedListeners, or spec.tls, which set Accepted=False) report Programmed=False with reason Invalid without provisioning a default CloudflareTunnel. If cloudflared configuration compilation fails at runtime after admission, Flareway demotes CloudflareTunnel ConfigApplied=False (ConfigurationError) and sets the Gateway and its listeners Programmed=False (Invalid).

While a Gateway cannot program its Tunnel (not yet owned, owned by another Gateway, draining, ObserveOnly, remotely deleted, waiting for connector credentials, or rejected by the Tunnel controller), the Gateway still reports Accepted, status.listeners, and HTTPRoute status.parents for its current generation. Programmed=False names the blocking state; when the Tunnel’s own Accepted=False condition is current, the message carries its reason and message. Listener grant checks run against the Tunnel’s CloudflareAccount, so a namespace or hostname that is not granted shows up as listener Accepted=False. Nothing is published or written to the Tunnel in this state.

The Tunnel controller and the AccessApplication controller check the namespace grant before they resolve zones or targets, so a namespace that no grant selects reports Accepted=False/RefNotPermitted.

Applied hostname status and Access transitions

Section titled “Applied hostname status and Access transitions”

status.hostnames[] records each applied hostname’s protectionDomain, accessApplication, guard (Forwarding, Blocked, or Unprotected), and appliedVersion. Its optional accessBinding is a SHA-256 digest of the application’s namespaced key, canonical AUD set, team name and auth domain, preflight-bypass setting, and origin-JWT mode. Disabled origin-JWT enforcement uses an application-and-mode digest without an AUD handoff. Status exposes the digest, never the AUD values.

When an Access binding changes, Flareway first applies a blocked configuration for the affected protection domain. Each public protected hostname has its own domain; private hostnames sharing a route table transition together. Public listeners and protected domains keep their recorded status.listeners[].protectionDomains[].envoyPort bindings across listener additions, removals, and upgrades, while newly added domains receive deterministic unused hash ports so unrelated traffic does not shift ports. While an Access block-first transition, unready Access application, or revocation hold keeps a domain blocked, the affected listener and Gateway remain Programmed=False (Pending). Once every active cloudflared Pod reports that configuration version and Envoy acknowledges its snapshot, the controller records the blocked guards and new digests, then publishes the forwarding configuration. Independent protection domains with unchanged bindings keep their guards through unrelated configuration changes. A missing digest in older status counts as a changed binding, including when the old guard is already Blocked; the blocked configuration records the new digest so the transition completes once.

The same Pod-version and xDS evidence advances status.configVersion.applied, status.hostnames[].appliedVersion, and ConfigApplied independently of managed DNS and private routing prerequisites. These applied checkpoints describe the published configuration, including denied hostnames. Gateway Programmed still requires all listener prerequisites. Each public listener requires exactly one managed DNS record with state: Ready, matched using canonical normalized DNS hostnames. Missing records, empty or unknown states, and duplicates keep it pending; a conflicted record reports Programmed=False with reason DNSConflict. Each private listener requires its own ready VirtualNetwork, HostnameRoute, and origin-JWT TLS-decryption contract. A missing listener prerequisite blocks that listener’s configuration before publication; healthy listeners can forward and report Programmed=True. Shared account and DeviceSettings prerequisites affect all private listeners. dns.mode: External skips the managed-DNS gate.

When retiring an obsolete generated HostnameRoute, such as after a private listener rename, Flareway also blocks active listeners that could reuse that route. Those listeners remain pending until a current non-deleting route is Applied, including when automatic route creation is disabled. Unrelated listeners keep forwarding.

Tunnel Ready retains its TunnelReady && ConfigApplied && DNSReady definition. It can be true while a private listener is blocked; use Gateway and listener Programmed conditions to check private routing availability.

status.dnsRecords[] also reports newly discovered foreign or ambiguous records as state: Conflict. These entries carry the required hostname and zone, with an empty recordId and no ownershipComment, so reporting a conflict does not claim or modify the foreign record. Deleting a tunnel clears synthetic conflict-only entries locally (including under deletionPolicy: Orphan) without attempting remote record deletion. A previously managed record retains its ownership checkpoint for safe cleanup.

Direct is an explicit whole-object alternative. It cannot be combined with Gateway-owned connector, proxy, privateDNS, Gateway-mode originRequest, or listeners.

apiVersion: flareway.bhyoo.com/v1alpha1
kind: CloudflareTunnel
metadata:
name: direct-origin
namespace: flareway-platform
spec:
accountRef: {name: production}
tunnel: {name: direct-origin}
configuration:
mode: Direct
direct:
ingress:
- hostname: app.example.com
path: ^/api
service: {https: {address: api.default.svc.cluster.local:8443}}
originRequest:
originServerName: api.internal
http2Origin: true
connectTimeout: 30
tlsTimeout: 10
- hostname: ssh.example.com
service: {ssh: {address: sshd.default.svc.cluster.local:22}}
originRequest:
proxyType: Regular
tcpKeepAlive: 30
- service: {httpStatus: {code: 404}}
originRequest:
noHappyEyeballs: false
keepAliveConnections: 100
keepAliveTimeout: 90
warpRouting:
enabled: true
connectTimeout: 30
tcpKeepAlive: 30
maxActiveFlows: 1000
dns:
mode: Managed
proxied: true
ttl: 1

Each ingress rule selects exactly one service:

  • address services: http, https, tcp, ssh, rdp, smb;
  • socket services: unix, unixTLS;
  • built-ins: helloWorld, httpStatus, bastion.

The final rule must be a catch-all with no hostname or path. originRequest.access is valid for HTTP, HTTPS, Unix HTTP, and Unix TLS origins. originRequest.ipRules requires bastion or proxyType: SOCKS5.

The complete Direct originRequest surface is access (audTags, teamName, required), caPool, connectTimeout, disableChunkedEncoding, http2Origin, httpHostHeader, keepAliveConnections, keepAliveTimeout, matchSNIToHost, noHappyEyeballs, noTLSVerify, originServerName, proxyType: Regular|SOCKS5, tcpKeepAlive, tlsTimeout, and ipRules. warpRouting exposes enabled, connectTimeout, tcpKeepAlive, and maxActiveFlows.

dns.mode is Managed or External and applies to both configuration modes. Managed DNS exposes recordComment, proxied, ttl, and settings.ipv4Only|ipv6Only.

  • A proxied record requires automatic TTL (1).
  • ipv4Only and ipv6Only are mutually exclusive.
  • Either IP-family setting requires proxied: true.
  • Flareway uses the DNS comment as the ownership ledger and does not overwrite a foreign record.

WARPConnector is a distinct Cloudflare Mesh connector without a Gateway data plane.

spec.name is trimmed at its edges before matching or creation; comparison remains case-sensitive, and the name is never an adoption key. A live connector with the same exact normalized name causes Conflict unless the object uses adoption.mode: AdoptById, supplies externalRef.tunnelId, and sets a non-empty adoption.expect.name that exactly matches the remote connector. A case difference also requires explicit adoption. For an interrupted create, Flareway recovers only from its controller-owned status checkpoint and only when exactly one live connector matches the checkpointed account, name, WARP Connector type, create-only HA capability, and candidate tunnel ID recorded by the observed HA configuration. Unknown HA configuration modes and user annotations cannot authorize recovery or adoption.

apiVersion: flareway.bhyoo.com/v1alpha1
kind: WARPConnector
metadata:
name: mesh-egress
namespace: flareway-platform
spec:
accountRef: {name: production}
name: mesh-egress
highAvailability:
enabled: true
mode: Local
local:
vips:
- {address: 10.40.0.10}
managementPolicy: Managed
deletionPolicy: Orphan

highAvailability.enabled is create-only. mode is None, Disabled, AWS, or Local. AWS requires aws.fnrId; Local requires local.vips[] and may declare vipsPrevious[]. failover contains a linked clientId and a changing requestId. The controller writes the connector token to a Secret and records only bounded clients, edge connections, HA state, and failover status.

VirtualNetwork owns one account-scoped virtual network with a remote name, default-network flag, and comment. Observe-only or managed adoption uses externalRef.virtualNetworkId; a managed external reference requires AdoptById. NetworkRoute and HostnameRoute can then select that network through virtualNetworkRef.

Private routes use a typed tunnel reference:

apiVersion: flareway.bhyoo.com/v1alpha1
kind: NetworkRoute
metadata:
name: payments-cidr
namespace: flareway-platform
spec:
accountRef: {name: production}
network: 10.40.0.0/16
tunnelRef:
kind: WARPConnector
name: mesh-egress
namespace: flareway-platform
virtualNetworkRef: {name: production}
allowedNamespaces:
from: Same
deletionPolicy: Orphan

TunnelReference.kind is CloudflareTunnel or WARPConnector; omission defaults to CloudflareTunnel. NetworkRoute and HostnameRoute both use this reference and allowedNamespaces.from: Same|All|Selector (default Same). The route controller checks the namespace of the referenced tunnel against allowedNamespaces and reports RefNotPermitted when it is not admitted, so a Same route must reference a tunnel in its own namespace. A DeviceProfile can include a route only when the route’s allowedNamespaces admits the profile’s namespace.

Zero Trust organization, Gateway policies, and lists

Section titled “Zero Trust organization, Gateway policies, and lists”

ZeroTrustOrganization is a namespaced singleton and must be named default. It manages an account- or zone-scoped Access organization, including session settings, WARP authentication, unmatched-request behavior, custom deny pages, login design, MFA and PIV requirements, user revocation, and account-scoped DoH authentication through a ServiceToken reference. authDomain is create-only. Cloudflare exposes no organization delete operation, so deletionPolicy is always Orphan.

ZeroTrustList owns one complete Cloudflare Gateway list and all of its items. type is SERIAL, URL, DOMAIN, EMAIL, or IP. Managed replacement and adoption are explicit; ObserveOnly status reports the item-level additions and removals that Managed mode would apply.

ZeroTrustGatewayPolicy owns one Gateway rule. It accepts exactly one filter, l4 or dns, plus a Cloudflare action, traffic expression, optional identity and device-posture expressions, typed rule settings, and references to same-namespace ZeroTrustList objects. DNS override and L4-only l4_override or audit_ssh actions are schema-restricted to the matching filter.

Use this sequence when moving an existing remote object under Flareway:

  1. Set managementPolicy: ObserveOnly, externalRef, and deletionPolicy: Orphan.
  2. Resolve drift shown in conditions or bounded observed/would-apply status.
  3. Set managementPolicy: Managed, adoption.mode: AdoptById, and adoption.expect values that identify the intended remote object.
  4. Change deletionPolicy only after ownership is verified.

Use the same process for bypass-child applications. Do not switch an application’s immutable type, infer a Tunnel mode, replace a typed route kind, or recreate a missing one-time Secret as part of adoption. These operations can change IDs, AUDs, or credentials and require a deliberate replacement plan.

The remote ownership ledger uses tags where Cloudflare supports tags, deterministic comments for DNS and private-network resources, prefixed names where only names exist, and status remote IDs. A foreign or ambiguous marker produces Conflict; the controller does not overwrite the object.

Ownership and adoption explains how the ledger, adoption, and teardown fit together.

Cloudflare API category Kubernetes representation
create/update field typed spec field or typed reference
create-only secret controller-owned Secret or user-provided Secret reference
remote identity and mutable observation bounded status
connection lists bounded status collections
server-owned timestamps, generated domains/audiences, read_only status only
HTTP success, errors, messages, result envelope excluded
pagination and result-info excluded
deprecated wire aliases excluded; canonical fields only
mutable field outside Flareway’s resource model excluded from desired configuration and configuration drift detection; generic identity checks and shared response metadata may still apply

Envelope and read-only exclusions define ownership; they are not feature-availability statements. The controllers consume the envelope internally, surface actionable failures as conditions, and keep response metadata out of desired state.

A mutable field outside Flareway’s resource model belongs to a concern no Flareway kind owns. Flareway does not manage that configuration or detect drift in it. These exclusions include the Access application destinations[].overrides (per-path Access overrides; Flareway models public carve-outs as bypass applications instead) and the rule-format target_criteria[].include, .require, and .exclude selectors with their tags and target_attributes.hostname children; IdentityProvider config.google-apps.use_login_hint; and ZeroTrustOrganization service_token_inactivity (with action, enabled, inactivity_threshold_days) and strict_service_token_auth. The read-only trusted_accounts organization list output belongs to the same out-of-model concern and is neither read nor surfaced in status. Excluding a desired variant does not disable generic identity checks or the shared response observations described below.

Access application user_populations is also excluded. Flareway models policy-attached applications, not the organization-owned end-user population lifecycle. The end_user application variant requires a user population, a canonical allow-everyone policy, and managed OAuth, and is not a supported Flareway application type. Its excluded mutable members are type, user_populations, allowed_idps, destinations, domain, name, and the deprecated self_hosted_domains; destinations[].type, .uri, .worker_id, and .overrides (including behavior and path_pattern); and oauth_configuration, including enabled, dynamic_client_registration (allow_any_on_localhost, allow_any_on_loopback, allowed_uris, enabled), and grant (access_token_lifetime, session_duration). The CRD rejects end_user as a desired type. In the generic AccessStandaloneApplication ObserveOnly path, a nameless end_user response can record its id in status.applicationId while reporting Ready=False for drift. A named response also projects its unsupported type into status.type, so the CRD rejects that status patch. The response aud remains excluded. This limited identity observation does not support end-user configuration or ownership adoption; existing application variants retain their shared-field coverage.

The passkeys identity-provider variant is excluded from desired configuration and ownership adoption because Access-managed end-user credential enrollment is outside the IdentityProvider model. The excluded desired members are type, name, config and config.login_page_auto_prompt, saml_certificate_set_id, and scim_config, including its enablement and behavior settings. The response-only config.redirect_url remains excluded. Generic ObserveOnly identity checks and shared metadata observation still apply: status.idpId records the response id on a Ready observation; status.readOnly records read_only; and a present certificate-set ID or UID allows status.samlCertificateSet to record public certificate metadata. That metadata includes createdAt, updatedAt, the set id, and present current and previous certificates with id, current, notAfter, and publicCertificate. The response saml_certificate_set_id maps only to status.samlCertificateSet.id. If remote SCIM is already enabled and both user and group list calls succeed, status.scimDirectory records the bounded directory and its baseUrl; either list failure prevents a new directory snapshot. A returned SCIM secret stays in client memory and is never persisted in status or a Kubernetes Secret by ObserveOnly reconciliation. These observations retain ownershipVerified=false and do not add passkeys configuration support. Existing provider variants retain their typed configuration, SCIM, certificate, and status coverage.