Skip to content

cfgate.iocfgate v0.2.0-alpha.11 · Release documentation

CloudflareDNS schema

These fields come from the released CRD. Required means required when its parent object is present. Schema defaults do not describe every runtime fallback.

FieldTypeRequired in parentSchema defaultDescription
FieldTypeRequired in parentSchema defaultDescription
“objectnononeCloudflareDNS is the Schema for the cloudflarednses API.

CloudflareDNS manages DNS record synchronization independently from CloudflareTunnel resources.
It supports two target modes: tunnel references (for tunnel-based CNAME records) and external
targets (for non-tunnel DNS management). DNS records can be sourced from Gateway API routes
or explicitly defined.

CloudflareDNS implements ownership tracking via TXT records (aligned with external-dns patterns)
to enable safe multi-cluster deployments and prevent accidental deletion of records created
by other installations.

Status conditions:
- Ready: DNS sync is fully operational
- CredentialsValid: Cloudflare credentials have been validated
- ZonesResolved: All configured zones have been resolved via API
- RecordsSynced: DNS records have been synchronized to Cloudflare
- OwnershipVerified: TXT ownership records have been verified, when enabled
FieldTypeRequired in parentSchema defaultDescription
apiVersionstringnononeAPIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
FieldTypeRequired in parentSchema defaultDescription
kindstringnononeKind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
FieldTypeRequired in parentSchema defaultDescription
metadataobjectnonone
FieldTypeRequired in parentSchema defaultDescription
specobjectnononeCloudflareDNSSpec defines the desired state of a CloudflareDNS resource.

CloudflareDNSSpec configures DNS record synchronization, including the target
(tunnel or external), zones to manage, hostname sources, and ownership tracking.
Either tunnelRef or externalTarget must be specified (mutually exclusive).

Validation for spec:

x-kubernetes-validations:
- message: either tunnelRef or externalTarget must be specified
rule: has(self.tunnelRef) || has(self.externalTarget)
- message: tunnelRef and externalTarget are mutually exclusive
rule: "!(has(self.tunnelRef) && has(self.externalTarget))"
- message: cloudflare credentials required when using externalTarget
rule: has(self.tunnelRef) || has(self.cloudflare)
- message: TXT ownership prefix is immutable
rule: "(has(self.ownership) && has(self.ownership.txtRecord) &&
has(self.ownership.txtRecord.prefix) ? self.ownership.txtRecord.prefix :
'_cfgate') == (has(oldSelf.ownership) && has(oldSelf.ownership.txtRecord)
&& has(oldSelf.ownership.txtRecord.prefix) ?
oldSelf.ownership.txtRecord.prefix : '_cfgate')"
FieldTypeRequired in parentSchema defaultDescription
spec.cleanupPolicyobjectnononeCleanupPolicy defines cleanup behavior for records.
FieldTypeRequired in parentSchema defaultDescription
spec.cleanupPolicy.deleteOnResourceRemovalbooleannononeDeleteOnResourceRemoval deletes records when CloudflareDNS resource is deleted.
nil defaults to true.
FieldTypeRequired in parentSchema defaultDescription
spec.cleanupPolicy.deleteOnRouteRemovalbooleannononeDeleteOnRouteRemoval deletes obsolete hostname, type, or selected-zone records.
This applies to discovered routes and explicit hostnames.
nil defaults to true.
FieldTypeRequired in parentSchema defaultDescription
spec.cleanupPolicy.onlyManagedbooleannononeOnlyManaged is retained for compatibility. Ownership verification is always required;
setting false cannot authorize deletion of foreign or unmarked records.
FieldTypeRequired in parentSchema defaultDescription
spec.cloudflareobjectnononeCloudflare API credentials (required when using externalTarget).
When using tunnelRef, credentials are inherited from the tunnel.

Validation for spec.cloudflare:

x-kubernetes-validations:
- message: either accountId or accountName must be specified
rule: has(self.accountId) || has(self.accountName)
- message: accountId must be a 32-character hex string
rule: "!has(self.accountId) || self.accountId.matches('^[a-f0-9]{32}$')"
FieldTypeRequired in parentSchema defaultDescription
spec.cloudflare.accountIdstringnononeAccountID is the Cloudflare Account ID.

Validation for spec.cloudflare.accountId:

maxLength: 32
FieldTypeRequired in parentSchema defaultDescription
spec.cloudflare.accountNamestringnononeAccountName is the Cloudflare Account name. Will be looked up via API.

Validation for spec.cloudflare.accountName:

maxLength: 255
FieldTypeRequired in parentSchema defaultDescription
spec.cloudflare.secretKeysobjectnononeSecretKeys defines the key mappings within the secret.
FieldTypeRequired in parentSchema defaultDescription
spec.cloudflare.secretKeys.apiTokenstringno"CLOUDFLARE_API_TOKEN"APIToken is the key name for the Cloudflare API token.

Validation for spec.cloudflare.secretKeys.apiToken:

maxLength: 253
FieldTypeRequired in parentSchema defaultDescription
spec.cloudflare.secretRefobjectyesnoneSecretRef references the Secret containing Cloudflare API credentials.
The secret must contain an API token (not tunnel token).
FieldTypeRequired in parentSchema defaultDescription
spec.cloudflare.secretRef.namestringyesnoneName of the secret.

Validation for spec.cloudflare.secretRef.name:

maxLength: 253
minLength: 1
FieldTypeRequired in parentSchema defaultDescription
spec.cloudflare.secretRef.namespacestringnononeNamespace of the secret. Defaults to the tunnel’s namespace.

Validation for spec.cloudflare.secretRef.namespace:

maxLength: 63
FieldTypeRequired in parentSchema defaultDescription
spec.defaultsobjectnononeDefaults defines default settings for DNS records.

Validation for spec.defaults:

x-kubernetes-validations:
- message: TTL must be 1 (auto) or between 60 and 86400 seconds
rule: "!has(self.ttl) || self.ttl == 1 || (self.ttl >= 60 && self.ttl <= 86400)"
FieldTypeRequired in parentSchema defaultDescription
spec.defaults.proxiedbooleannotrueProxied enables Cloudflare proxy by default.
FieldTypeRequired in parentSchema defaultDescription
spec.defaults.ttlintegerno1TTL is the default DNS record TTL in seconds.
Valid values: 1 (auto) or 60-86400 (explicit).

Validation for spec.defaults.ttl:

format: int32
maximum: 86400
minimum: 1
FieldTypeRequired in parentSchema defaultDescription
spec.externalTargetobjectnononeExternalTarget specifies a non-tunnel DNS target.
FieldTypeRequired in parentSchema defaultDescription
spec.externalTarget.typestringyesnoneType is the DNS record type.

Allowed values for spec.externalTarget.type: ["CNAME","A","AAAA"].

FieldTypeRequired in parentSchema defaultDescription
spec.externalTarget.valuestringyesnoneValue is the target value (domain for CNAME, IP for A/AAAA).
Max 253: RFC 1035 section 2.3.4 FQDN presentation-format limit.

Validation for spec.externalTarget.value:

maxLength: 253
minLength: 1
FieldTypeRequired in parentSchema defaultDescription
spec.fallbackCredentialsRefobjectnononeFallbackCredentialsRef references fallback Cloudflare API credentials.
Used during deletion when primary credentials are unavailable.
FieldTypeRequired in parentSchema defaultDescription
spec.fallbackCredentialsRef.namestringyesnoneName of the secret.

Validation for spec.fallbackCredentialsRef.name:

maxLength: 253
minLength: 1
FieldTypeRequired in parentSchema defaultDescription
spec.fallbackCredentialsRef.namespacestringnononeNamespace of the secret. Defaults to the resource’s namespace if empty.

Validation for spec.fallbackCredentialsRef.namespace:

maxLength: 63
FieldTypeRequired in parentSchema defaultDescription
spec.ownershipobjectnononeOwnership defines how to track record ownership.
FieldTypeRequired in parentSchema defaultDescription
spec.ownership.commentobjectnononeComment configures comment-based ownership.

Deprecated: since v0.1.0-alpha.13. All fields are ignored. Will be removed in a future cleanup release.
FieldTypeRequired in parentSchema defaultDescription
spec.ownership.comment.enabledbooleannofalseEnabled enables comment-based ownership tracking.

Deprecated: since v0.1.0-alpha.13. This field is ignored. The controller always
writes an exact resource owner marker. Will be removed in a future cleanup release.
FieldTypeRequired in parentSchema defaultDescription
spec.ownership.comment.templatestringno"managed by cfgate"Template is the comment template.

Deprecated: since v0.1.0-alpha.13. This field is ignored. The controller always
uses an exact resource owner marker. Will be removed in a future cleanup release.

Validation for spec.ownership.comment.template:

maxLength: 255
FieldTypeRequired in parentSchema defaultDescription
spec.ownership.ownerIdstringnononeOwnerID is a deprecated legacy migration hint, not an ownership authority.
Since v0.2.0-alpha.6 the controller persists installation/resource UIDs in status.ownerId.
Setting this field cannot adopt another resource’s records.

Validation for spec.ownership.ownerId:

maxLength: 253
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(/[a-z0-9]([-a-z0-9]*[a-z0-9])?)?$
FieldTypeRequired in parentSchema defaultDescription
spec.ownership.txtRecordobjectnononeTXTRecord configures TXT record-based ownership.
FieldTypeRequired in parentSchema defaultDescription
spec.ownership.txtRecord.enabledbooleannononeEnabled enables TXT record ownership tracking.
nil defaults to true.
FieldTypeRequired in parentSchema defaultDescription
spec.ownership.txtRecord.prefixstringno"_cfgate"Prefix is the immutable prefix for TXT record names.

Validation for spec.ownership.txtRecord.prefix:

maxLength: 63
FieldTypeRequired in parentSchema defaultDescription
spec.policystringno"sync"Policy controls DNS record lifecycle.

Allowed values for spec.policy: ["sync","upsert-only","create-only"].

FieldTypeRequired in parentSchema defaultDescription
spec.sourceobjectnononeSource defines where to get hostnames to sync.
FieldTypeRequired in parentSchema defaultDescription
spec.source.explicitarraynononeExplicit defines explicit hostnames to sync.

Validation for spec.source.explicit:

maxItems: 100
FieldTypeRequired in parentSchema defaultDescription
spec.source.explicit[]objectnononeDNSExplicitHostname defines an explicit hostname to sync with optional per-hostname configuration.

DNSExplicitHostname provides direct specification of DNS hostnames without depending on
Gateway API route discovery. The Target field supports the {{ .TunnelDomain }} template
variable for dynamic resolution when using tunnelRef.

Validation for spec.source.explicit[]:

x-kubernetes-validations:
- message: TTL must be 1 (auto) or between 60 and 86400 seconds
rule: "!has(self.ttl) || self.ttl == 1 || (self.ttl >= 60 && self.ttl <= 86400)"
FieldTypeRequired in parentSchema defaultDescription
spec.source.explicit[].hostnamestringyesnoneHostname is the DNS hostname to create.
Max 253: RFC 1035 section 2.3.4 FQDN presentation-format limit.

Validation for spec.source.explicit[].hostname:

maxLength: 253
minLength: 1
x-kubernetes-validations:
- message: each DNS label must not exceed 63 octets (RFC 1035 section 2.3.4)
rule: self.split('.').all(s, size(s) <= 63)
FieldTypeRequired in parentSchema defaultDescription
spec.source.explicit[].proxiedbooleannononeProxied enables Cloudflare proxy for this record.
nil inherits from zone or defaults.
FieldTypeRequired in parentSchema defaultDescription
spec.source.explicit[].targetstringnononeTarget overrides the resolved record target for this hostname.
Supports template variable {{ .TunnelDomain }} when tunnelRef is used.
Defaults to the resource-level resolved target when omitted.
Max 253: RFC 1035 section 2.3.4 FQDN presentation-format limit.

Validation for spec.source.explicit[].target:

maxLength: 253
FieldTypeRequired in parentSchema defaultDescription
spec.source.explicit[].ttlintegernononeTTL is the DNS record TTL in seconds. 1 means auto (Cloudflare managed).
Omitted values inherit spec.defaults.ttl. Valid values: 1 (auto) or 60-86400.

Validation for spec.source.explicit[].ttl:

format: int32
maximum: 86400
minimum: 1
FieldTypeRequired in parentSchema defaultDescription
spec.source.gatewayRoutesobjectnononeGatewayRoutes configures watching Gateway API routes.
FieldTypeRequired in parentSchema defaultDescription
spec.source.gatewayRoutes.annotationFilterstringnononeAnnotationFilter only syncs routes with this annotation.

Validation for spec.source.gatewayRoutes.annotationFilter:

maxLength: 255
FieldTypeRequired in parentSchema defaultDescription
spec.source.gatewayRoutes.enabledbooleannotrueEnabled enables watching Gateway API routes.
FieldTypeRequired in parentSchema defaultDescription
spec.source.gatewayRoutes.namespaceSelectorobjectnononeNamespaceSelector limits route discovery to specific namespaces.

Validation for spec.source.gatewayRoutes.namespaceSelector:

x-kubernetes-validations:
- message: at least one selector must be specified
rule: has(self.matchLabels) || has(self.matchNames)
FieldTypeRequired in parentSchema defaultDescription
spec.source.gatewayRoutes.namespaceSelector.matchLabelsobjectnononeMatchLabels selects namespaces with matching labels.
FieldTypeRequired in parentSchema defaultDescription
spec.source.gatewayRoutes.namespaceSelector.matchLabels[key]stringnonone
FieldTypeRequired in parentSchema defaultDescription
spec.source.gatewayRoutes.namespaceSelector.matchNamesarraynononeMatchNames selects namespaces by name.

Validation for spec.source.gatewayRoutes.namespaceSelector.matchNames:

maxItems: 50
FieldTypeRequired in parentSchema defaultDescription
spec.source.gatewayRoutes.namespaceSelector.matchNames[]stringnonone
FieldTypeRequired in parentSchema defaultDescription
spec.tunnelRefobjectnononeTunnelRef references a CloudflareTunnel for CNAME target resolution.
FieldTypeRequired in parentSchema defaultDescription
spec.tunnelRef.namestringyesnoneName is the name of the CloudflareTunnel.

Validation for spec.tunnelRef.name:

maxLength: 63
minLength: 1
FieldTypeRequired in parentSchema defaultDescription
spec.tunnelRef.namespacestringnononeNamespace is the namespace of the CloudflareTunnel.
Defaults to the CloudflareDNS’s namespace.

Validation for spec.tunnelRef.namespace:

maxLength: 63
FieldTypeRequired in parentSchema defaultDescription
spec.zonesarrayyesnoneZones defines the DNS zones to manage.

Validation for spec.zones:

maxItems: 10
minItems: 1
FieldTypeRequired in parentSchema defaultDescription
spec.zones[]objectnononeDNSZoneConfig defines a DNS zone where records will be managed.

DNSZoneConfig identifies a Cloudflare DNS zone either by name (requiring API lookup)
or by explicit zone ID. The optional Proxied field sets the default proxy behavior
for all records in this zone.
FieldTypeRequired in parentSchema defaultDescription
spec.zones[].idstringnononeID is the optional explicit zone ID (skips API lookup).

Validation for spec.zones[].id:

maxLength: 32
pattern: ^[a-f0-9]{32}$
FieldTypeRequired in parentSchema defaultDescription
spec.zones[].namestringyesnoneName is the zone domain name (e.g., example.com).
Max 253: RFC 1035 section 2.3.4 FQDN presentation-format limit.

Validation for spec.zones[].name:

maxLength: 253
minLength: 1
x-kubernetes-validations:
- message: each DNS label must not exceed 63 octets (RFC 1035 section 2.3.4)
rule: self.split('.').all(s, size(s) <= 63)
FieldTypeRequired in parentSchema defaultDescription
spec.zones[].proxiedbooleannononeProxied sets the default proxied setting for this zone.
nil inherits from spec.defaults.proxied.
FieldTypeRequired in parentSchema defaultDescription
statusobjectnononeCloudflareDNSStatus defines the observed state of a CloudflareDNS resource.

CloudflareDNSStatus captures the synchronization state of all DNS records, including
counts of synced, pending, and failed records. The ResolvedTarget field shows the
actual CNAME target being used (either from tunnel or external target).
FieldTypeRequired in parentSchema defaultDescription
status.conditionsarraynononeConditions represent the latest available observations.

Validation for status.conditions:

x-kubernetes-list-map-keys:
- type
x-kubernetes-list-type: map
FieldTypeRequired in parentSchema defaultDescription
status.conditions[]objectnononeCondition contains details for one aspect of the current state of this API Resource.
FieldTypeRequired in parentSchema defaultDescription
status.conditions[].lastTransitionTimestringyesnonelastTransitionTime is the last time the condition transitioned from one status to another.
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.

Validation for status.conditions[].lastTransitionTime:

format: date-time
FieldTypeRequired in parentSchema defaultDescription
status.conditions[].messagestringyesnonemessage is a human readable message indicating details about the transition.
This may be an empty string.

Validation for status.conditions[].message:

maxLength: 32768
FieldTypeRequired in parentSchema defaultDescription
status.conditions[].observedGenerationintegernononeobservedGeneration represents the .metadata.generation that the condition was set based upon.
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
with respect to the current state of the instance.

Validation for status.conditions[].observedGeneration:

format: int64
minimum: 0
FieldTypeRequired in parentSchema defaultDescription
status.conditions[].reasonstringyesnonereason contains a programmatic identifier indicating the reason for the condition’s last transition.
Producers of specific condition types may define expected values and meanings for this field,
and whether the values are considered a guaranteed API.
The value should be a CamelCase string.
This field may not be empty.

Validation for status.conditions[].reason:

maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
FieldTypeRequired in parentSchema defaultDescription
status.conditions[].statusstringyesnonestatus of the condition, one of True, False, Unknown.

Allowed values for status.conditions[].status: ["True","False","Unknown"].

FieldTypeRequired in parentSchema defaultDescription
status.conditions[].typestringyesnonetype of condition in CamelCase or in foo.example.com/CamelCase.

Validation for status.conditions[].type:

maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
FieldTypeRequired in parentSchema defaultDescription
status.failedRecordsintegernononeFailedRecords is the number of records that failed to sync.

Validation for status.failedRecords:

format: int32
FieldTypeRequired in parentSchema defaultDescription
status.lastSyncTimestringnononeLastSyncTime is the last time records were synced.

Validation for status.lastSyncTime:

format: date-time
FieldTypeRequired in parentSchema defaultDescription
status.observedGenerationintegernononeObservedGeneration is the generation observed by the controller.

Validation for status.observedGeneration:

format: int64
FieldTypeRequired in parentSchema defaultDescription
status.ownerIdstringnononeOwnerID persists the installation namespace UID and resource UID for cleanup.
FieldTypeRequired in parentSchema defaultDescription
status.ownershipPrefixstringnononeOwnershipPrefix pins the claim namespace used for publication and cleanup.
FieldTypeRequired in parentSchema defaultDescription
status.pendingRecordsintegernononePendingRecords is the number of records pending sync.

Validation for status.pendingRecords:

format: int32
FieldTypeRequired in parentSchema defaultDescription
status.pendingWritesarraynononePendingWrites retains destinations until their results are durably recorded.

Validation for status.pendingWrites:

maxItems: 1000
FieldTypeRequired in parentSchema defaultDescription
status.pendingWrites[]objectnononeDNSPendingWrite records a destination before an external write. It survives
failed status writes and later edits to the desired zones or hostnames.
FieldTypeRequired in parentSchema defaultDescription
status.pendingWrites[].hostnamestringyesnoneHostname and Type identify the intended record.
FieldTypeRequired in parentSchema defaultDescription
status.pendingWrites[].operationIdstringyesnoneOperationID distinguishes a creation from another record incarnation.

Validation for status.pendingWrites[].operationId:

pattern: ^[A-Za-z0-9_-]{10}$
FieldTypeRequired in parentSchema defaultDescription
status.pendingWrites[].previousOwnedbooleannononePreviousOwned distinguishes an unowned baseline from a foreign replacement.
FieldTypeRequired in parentSchema defaultDescription
status.pendingWrites[].previousRecordIdstringnononePreviousRecordID identifies an existing owned record before an update.
FieldTypeRequired in parentSchema defaultDescription
status.pendingWrites[].typestringyesnone
FieldTypeRequired in parentSchema defaultDescription
status.pendingWrites[].zoneIdstringyesnoneZoneID is the resolved destination, independent of current spec.zones.
FieldTypeRequired in parentSchema defaultDescription
status.recordsarraynononeRecords contains the status of individual DNS records.

Validation for status.records:

maxItems: 1000
FieldTypeRequired in parentSchema defaultDescription
status.records[]objectnononeDNSRecordSyncStatus represents the synchronization status of a single DNS record.

DNSRecordSyncStatus tracks individual DNS record state including the Cloudflare record ID,
current configuration, and sync status. The Status field indicates: Synced (successfully
synchronized), Pending (awaiting sync), Skipped (policy prevented synchronization), or Failed (sync failed, see Error field).
FieldTypeRequired in parentSchema defaultDescription
status.records[].errorstringnononeError contains the error message if status is Failed.
FieldTypeRequired in parentSchema defaultDescription
status.records[].hostnamestringyesnoneHostname is the DNS hostname.
FieldTypeRequired in parentSchema defaultDescription
status.records[].proxiedbooleanyesnoneProxied indicates if Cloudflare proxy is enabled.
FieldTypeRequired in parentSchema defaultDescription
status.records[].recordIdstringnononeRecordID is the Cloudflare record ID.
FieldTypeRequired in parentSchema defaultDescription
status.records[].statusstringyesnoneStatus is the sync status: Synced, Pending, Skipped, Failed.
FieldTypeRequired in parentSchema defaultDescription
status.records[].targetstringyesnoneTarget is the record target/content.
FieldTypeRequired in parentSchema defaultDescription
status.records[].ttlintegernononeTTL is the record TTL.

Validation for status.records[].ttl:

format: int32
FieldTypeRequired in parentSchema defaultDescription
status.records[].typestringyesnoneType is the DNS record type (CNAME, A, AAAA).
FieldTypeRequired in parentSchema defaultDescription
status.records[].zoneIdstringnononeZoneID is the Cloudflare zone ID where the record was created.
FieldTypeRequired in parentSchema defaultDescription
status.resolvedTargetstringnononeResolvedTarget is the resolved CNAME target (tunnel domain or external value).
FieldTypeRequired in parentSchema defaultDescription
status.syncedRecordsintegernononeSyncedRecords is the number of successfully synced records.

Validation for status.syncedRecords:

format: int32