DNSZone
DNSZone is a recorded grant of authority over a name space: the stone kept in the temple.
| API version | kudurru.io/v1alpha1 |
| Kind | DNSZone |
| Scope | Cluster |
| Resource | dnszones.kudurru.io |
| Short names | zone |
| Subresources | status |
Columns of kubectl get dnszones:
| Column | Type | Value |
|---|---|---|
| ZONE | string | .spec.zoneName |
| TYPE | string | .spec.type |
| SERIAL | integer | .status.serial |
| RECORDS | integer | .status.recordCount |
| READY | string | .status.conditions[?(@.type=="Ready")].status |
| AGE | date | .metadata.creationTimestamp |
Spec
DNSZoneSpec defines the desired state of a zone.
Validation: fallback is only supported for primary zones (!has(self.fallback) || self.type == 'primary')
Validation: secondary zones require secondary configuration (self.type != 'secondary' || has(self.secondary))
Validation: stub zones require nameserver configuration (self.type != 'stub' || has(self.stub))
| Field | Type | Description |
|---|---|---|
spec.defaultTTL | integer | Default: 300Format: int32 |
spec.dnssec | object | DNSSECSpec is reserved for v1.0 signing. The schema exists so that the seam is in place (dev-docs/design-record.md §13.1). |
spec.dnssec.algorithm | string | Default: ECDSAP256SHA256One of: ECDSAP256SHA256, ED25519 |
spec.dnssec.denial | string | Default: nsecOne of: nsec, nsec3 |
spec.dnssec.enabled | boolean | Required. |
spec.dnssec.keySecretRef | object | ObjectRef points at another kudurru object. Namespace is omitted for cluster-scoped kinds and for same-namespace references. |
spec.dnssec.keySecretRef.name | string | Required. Length: at least 1 |
spec.dnssec.keySecretRef.namespace | string | |
spec.external | object | ExternalSpec synthesizes records from Kubernetes objects (v0.2, D402). It takes effect only when the server runs with externalZones.enabled on the Kubernetes store driver. The elected replica derives one DNSRecordSet per source object and zone in the source's namespace; the zone's recordSetSelector decides which namespaces and labels may contribute (derived record sets carry the source's labels). Names are placed in the external zone with the longest matching apex. Sources are only read. The external-dns annotations external-dns.kubernetes.io/hostname, /target and /ttl (and their external-dns.alpha.kubernetes.io forms) add names, replace targets and set the TTL. |
spec.external.gateway | boolean | Gateway publishes the hostnames of Gateway API HTTPRoutes, GRPCRoutes and TLSRoutes that a parent Gateway has accepted, at that Gateway's status addresses. A route without hostnames uses its listener's. |
spec.external.ingress | boolean | Ingress publishes networking.k8s.io/v1 Ingress rule and TLS hosts at the addresses in the Ingress status. |
spec.external.loadBalancerServices | boolean | LoadBalancerServices publishes Services of type LoadBalancer that carry a hostname annotation, at their load balancer addresses. |
spec.fallback | object | Fallback enables public resolution for names not defined locally. Omit it to remain authoritative for the entire zone. Generated apex SOA/NS records do not suppress fallback for other types at an unconfigured apex. Zones with fallback do not support zone transfers or NOTIFY. |
spec.fallback.upstreamGroup | string | UpstreamGroup selects a forwarding or recursive group. Empty uses normal resolver routing (client policy, conditional forwarding, then default). |
spec.forward | object | ForwardSpec configures a forward zone. |
spec.forward.dnssecValidation | boolean | DNSSECValidation overrides the global dnssec.enabled default for this route. Omit it to inherit the default. |
spec.forward.upstreamGroup | string | UpstreamGroup names a group in the Kudurru settings. Default: default |
spec.nameservers | []string | |
spec.policy | object | ZonePolicy controls who may query, transfer, be notified about and update the zone. |
spec.policy.notify | string | NotifyMode selects where NOTIFY messages are sent on serial change. Default: noneOne of: none, zoneNameServers, specified, both |
spec.policy.notifySource | string | NotifySource is the local unicast IPv4/IPv6 address for outbound NOTIFY. Empty inherits notify.source, then the system-selected source if unset. No hostnames, ports, scoped or IPv4-mapped IPv6 addresses are accepted. Bind or address-family failure never falls back to another source. Length: at most 45 Validation: must be empty or an unscoped unicast IPv4 or IPv6 address ( self == '' || (isIP(self) && (ip(self).isGlobalUnicast() || ip(self).isLoopback() || ip(self).isLinkLocalUnicast()))) |
spec.policy.notifyTSIGKeyRef | string | NotifyTSIGKeyRef selects the key for outbound NOTIFY independently of transfer authorization. Empty uses the first transferTSIGKeyRefs key; with neither configured NOTIFY is unsigned. A selected unavailable key fails delivery, without falling back to another key or unsigned traffic. Pattern: ^$|^([A-Za-z0-9_]([A-Za-z0-9_-]{0,61}[A-Za-z0-9_])?\.)*[A-Za-z0-9_]([A-Za-z0-9_-]{0,61}[A-Za-z0-9_])?\.?$Length: at most 254 Validation: must fit a DNS key name of 253 characters plus an optional trailing dot ( self.endsWith('.') || size(self) <= 253) |
spec.policy.notifyTargets | []string | |
spec.policy.queryACL | []string | QueryACL entries are CIDRs, optionally negated with a leading "!". Ordered, first match wins, default deny. |
spec.policy.queryAccess | string | AccessMode is Technitium's six-way access vocabulary applied to queries, transfers and dynamic updates. Default: allowOne of: deny, allow, allowOnlyPrivate, allowOnlyZoneNameServers, useNetworkACL, zoneNameServersAndACL |
spec.policy.transferACL | []string | |
spec.policy.transferTSIGKeyRefs | []string | |
spec.policy.update | string | Update controls RFC 2136 dynamic updates (v0.2). Default: denyOne of: deny, allow, allowOnlyPrivate, allowOnlyZoneNameServers, useNetworkACL, zoneNameServersAndACL |
spec.policy.updatePolicies | []object | |
spec.policy.updatePolicies[].name | string | Required. Name is an owner name or wildcard pattern within the zone. |
spec.policy.updatePolicies[].tsigKeyRef | string | Required. |
spec.policy.updatePolicies[].types | []string | |
spec.policy.zoneTransfer | string | AccessMode is Technitium's six-way access vocabulary applied to queries, transfers and dynamic updates. Default: denyOne of: deny, allow, allowOnlyPrivate, allowOnlyZoneNameServers, useNetworkACL, zoneNameServersAndACL |
spec.publish | []object | |
spec.publish[].integrationRef | object | Required. ObjectRef points at another kudurru object. Namespace is omitted for cluster-scoped kinds and for same-namespace references. |
spec.publish[].integrationRef.name | string | Required. Length: at least 1 |
spec.publish[].integrationRef.namespace | string | |
spec.publish[].policy | string | Default: syncOne of: sync, upsert-only, create-only |
spec.publish[].selector | object | A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects. |
spec.publish[].selector.matchExpressions | []object | matchExpressions is a list of label selector requirements. The requirements are ANDed. |
spec.publish[].selector.matchExpressions[].key | string | Required. key is the label key that the selector applies to. |
spec.publish[].selector.matchExpressions[].operator | string | Required. operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. |
spec.publish[].selector.matchExpressions[].values | []string | values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. |
spec.publish[].selector.matchLabels | map[string]string | matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. |
spec.publish[].types | []string | |
spec.recordSetSelector | object | RecordSetSelector restricts which DNSRecordSets may add records to the zone. |
spec.recordSetSelector.labelSelector | object | A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects. |
spec.recordSetSelector.labelSelector.matchExpressions | []object | matchExpressions is a list of label selector requirements. The requirements are ANDed. |
spec.recordSetSelector.labelSelector.matchExpressions[].key | string | Required. key is the label key that the selector applies to. |
spec.recordSetSelector.labelSelector.matchExpressions[].operator | string | Required. operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. |
spec.recordSetSelector.labelSelector.matchExpressions[].values | []string | values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. |
spec.recordSetSelector.labelSelector.matchLabels | map[string]string | matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. |
spec.recordSetSelector.namespaces | []string | |
spec.secondary | object | SecondarySpec configures a secondary zone (v0.2). |
spec.secondary.primaries | []string | Required. Primaries are ordered hostnames or IP addresses with optional ports (default 53). Use brackets around IPv6 addresses when specifying a port. Items: at least 1 |
spec.secondary.transferProtocol | string | TransferProtocol selects TCP or TLS with certificate and endpoint-name verification against the node's trust store. There is no plaintext fallback. Both protocols default to port 53; specify :853 for a standard TLS endpoint. Default: tcpOne of: tcp, tls |
spec.secondary.tsigKeyRef | string | TSIGKeyRef names a key configured in every replica's local keyring. |
spec.soa | object | SOASpec holds primary-zone SOA fields. The leader computes primary serials in status (D12); secondaries retain the external primary's complete SOA. |
spec.soa.expire | integer | Default: 1209600Format: int32 |
spec.soa.minimum | integer | Default: 300Format: int32 |
spec.soa.mname | string | |
spec.soa.refresh | integer | Default: 3600Format: int32 |
spec.soa.retry | integer | Default: 900Format: int32 |
spec.soa.rname | string | |
spec.stub | object | StubSpec configures node-local authoritative-server discovery. It does not transfer the full zone or enable general iterative resolution. |
spec.stub.nameservers | []string | Required. Nameservers bootstrap SOA/NS/glue discovery outside the query path. Entries are hostnames or IP addresses with optional ports (default 53), optionally prefixed with udp:// or tcp://. UDP retries TCP on truncation; explicit TCP stays TCP. TLS is not supported for stub discovery. Discovered nameservers inherit the bootstrap transport and port. Items: 1 to 16 |
spec.type | string | Required. ZoneType selects how a zone gets its data. One of: primary, forward, secondary, stub, external, catalog, secondaryCatalog |
spec.zoneName | string | Required. ZoneName is the fully qualified zone name with a trailing dot. Pattern: ^([a-zA-Z0-9_-]+\.)*$|^\.$Length: at least 1 Validation: zoneName is immutable ( self == oldSelf) |
Status
DNSZoneStatus is the observed state of a zone.
| Field | Type | Description |
|---|---|---|
status.conditions | []Condition | List type: map, keyed by type |
status.contentHash | string | ContentHash is the sha256 of the canonical served RRsets. With committed primary status, it includes dynamic records from the exact durable head. |
status.nameserverAddresses | []string | |
status.observedGeneration | integer | Format: int64 |
status.published | []object | |
status.published[].conflicts | integer | |
status.published[].drift | integer | |
status.published[].integration | string | Required. |
status.published[].lastSyncTime | string | Format: date-time |
status.published[].managed | integer | |
status.recordCount | integer | |
status.serial | integer | Serial describes committed primary data when the committed-status adapter is installed. Legacy controllers stamp max(prev+1, unix_now) when content changes. Secondary serials and counts belong to each replica's transferred data, not this shared status. Format: int32 |
Example
deploy/kustomize/samples/kudurru.io_v1alpha1_dnszone.yaml:
apiVersion: kudurru.io/v1alpha1
kind: DNSZone
metadata:
name: home-example-com
spec:
zoneName: home.example.com.
type: primary
soa:
mname: ns1.home.example.com.
rname: hostmaster.example.com.
refresh: 3600
retry: 900
expire: 1209600
minimum: 300
nameservers: [ns1.home.example.com., ns2.home.example.com.]
policy:
queryAccess: allow
zoneTransfer: useNetworkACL
transferACL: ["10.0.0.0/8"]
notify: zoneNameServers
update: deny
recordSetSelector:
namespaces: [dns, apps]
# v0.2 split-horizon: publish labelled records to a Cloudflare sink.
# publish:
# - integrationRef: { name: cf-public, namespace: dns }
# selector: { matchLabels: { kudurru.io/publish: cloudflare } }
# types: [A, AAAA, CNAME, TXT, MX, SRV, CAA]
# policy: sync