Skip to content
Documentation menu

Docs / Reference / DNS

Zone

Zone represents a DNS zone managed in Cloudflare.

API version
kflare.dev/v1alpha1
Scope
Namespaced
Short name
cfzone
Token permission
Zone · Zone · Edit (Read to adopt)

Example

Every field, with the sample's values. The live lines are the repository's sample, which applies as it is; the commented ones are the other fields, filled from other samples where one sets them. Some exclude each other, so check the rules before you uncomment several.

zone.yaml
apiVersion: kflare.dev/v1alpha1
kind: Zone
metadata:
  name: example-zone
  namespace: default
  annotations:
    kflare.dev/adoption-policy: adopt
spec:
  name: example.com
  accountRef:
    name: my-account
  type: full
  # plan: free  # one of: free, pro, business, enterprise

Spec

What you set, with the limits the API server enforces.

FieldDescription
accountRef
objectrequiredimmutable

AccountRef references the CloudflareAccount that owns the zone. Immutable after creation.

accountRef.name
string

Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

Default: ""

name
stringrequiredimmutable

Name is the domain (e.g. "example.com"). Immutable after creation.

Limits: matches ^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$

plan
string

Plan is the zone's billing plan: free, pro, business, or enterprise. When unset, kflare leaves the plan alone. When set, kflare subscribes the zone to it, which bills the account's default payment method. Enterprise cannot be bought through the API; set it only for a zone that is already on Enterprise. Downgrades take effect at the end of the billing period and show up in status.cloudflareMetadata.pendingPlan.

One of: free, pro, business, enterprise

type
string

Type is the zone type: "full" (Cloudflare manages DNS) or "partial" (proxy only).

Default: full

One of: full, partial

Status

What kflare reports. conditions holds the Ready condition, whose reason says why a resource isn't ready.

FieldDescription
cloudflareMetadata
object

CloudflareMetadata holds identifiers returned by the Cloudflare API.

cloudflareMetadata.nameServers
[]string

NameServers are the authoritative name servers assigned by Cloudflare.

cloudflareMetadata.pendingPlan
string

PendingPlan is a plan change Cloudflare has scheduled for the end of the billing period, such as a downgrade.

cloudflareMetadata.plan
string

Plan is the zone's current billing plan (free, pro, business or enterprise).

cloudflareMetadata.status
string

Status is the zone activation status as reported by Cloudflare (active, pending, initializing, moved, deactivated).

cloudflareMetadata.zoneID
string

ZoneID is the Cloudflare zone identifier.

conditions
[]object

Conditions represent the latest available observations of the zone state.

kubectl get

The columns kubectl get zones prints.

ColumnSource
DOMAIN.spec.name
ZONE ID.status.cloudflareMetadata.zoneID
PLAN.status.cloudflareMetadata.plan
CF STATUS.status.cloudflareMetadata.status
READY.status.conditions[?(@.type=="Ready")].status
AGE.metadata.creationTimestamp

Samples

From the repository's config/samples, comments included.

cloudflare_v1alpha1_zone.yaml
apiVersion: kflare.dev/v1alpha1
kind: Zone
metadata:
  name: example-zone
  namespace: default
  annotations:
    # The account already has this zone: take it over. Without this annotation kflare only creates zones, and
    # reports AlreadyExists for one that exists. An adopted zone is kept when this resource is deleted.
    kflare.dev/adoption-policy: adopt
spec:
  name: example.com
  accountRef:
    name: my-account
  type: full

On GitHub