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.
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, enterpriseSpec
What you set, with the limits the API server enforces.
| Field | Description |
|---|---|
accountRefobjectrequiredimmutable | AccountRef references the CloudflareAccount that owns the zone. Immutable after creation. |
accountRef.namestring | 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: |
namestringrequiredimmutable | Name is the domain (e.g. "example.com"). Immutable after creation. Limits: matches |
planstring | 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: |
typestring | Type is the zone type: "full" (Cloudflare manages DNS) or "partial" (proxy only). Default: One of: |
Status
What kflare reports. conditions holds the Ready condition, whose reason says why a resource isn't ready.
| Field | Description |
|---|---|
cloudflareMetadataobject | CloudflareMetadata holds identifiers returned by the Cloudflare API. |
cloudflareMetadata.nameServers[]string | NameServers are the authoritative name servers assigned by Cloudflare. |
cloudflareMetadata.pendingPlanstring | PendingPlan is a plan change Cloudflare has scheduled for the end of the billing period, such as a downgrade. |
cloudflareMetadata.planstring | Plan is the zone's current billing plan (free, pro, business or enterprise). |
cloudflareMetadata.statusstring | Status is the zone activation status as reported by Cloudflare (active, pending, initializing, moved, deactivated). |
cloudflareMetadata.zoneIDstring | 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.
| Column | Source |
|---|---|
| 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.
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