Reference / experimental
coredns
These docs describe Kix's main branch, which can include changes not yet released. Read the docs for the latest release.
CoreDNS as the cluster DNS: a Corefile built from typed server blocks, a Service at the kubelet’s clusterDNS address, and the dns role
This page is generated from kix/packages/experimental/coredns.
| Stability | Experimental |
package value | packages.experimental.coredns |
| Default software version | 1.15.0 |
| Roles | dns |
Dependencies
Section titled “Dependencies”Kix matches each dependency below to another package instance by instance name, alias, or role. To bind a specific instance, set deps.<name> in your cluster definition. See Declaring dependencies for how required and optional dependencies work.
| Dependency | Requirement |
|---|---|
prometheus | Optional |
Options
Section titled “Options”clusterIP
Section titled “clusterIP”Address of the Service. It must equal the kubelet’s clusterDNS,
which every pod’s resolv.conf names: clusterDNS in the kubelet
config (kubectl -n kube-system get cm kubelet-config -o yaml on
kubeadm), --cluster-dns on k3s and RKE2. Typically 10.96.0.10 on
kubeadm and 10.43.0.10 on k3s and RKE2.
- Type:
IPv4 or IPv6 address literal - Example:
"10.96.0.10"
Extra environment variables. A value is a string, a fieldRef source such as { valueFrom.fieldRef.fieldPath = "metadata.name"; }, or a secretKeyRef source naming a Secret managed outside Kix with kix.untrackedRef. A credential that comes from a dependency is wired by the package. Null removes a variable the package sets by default.
- Type:
attribute set of (null or string or env var source with `valueFrom`) - Default:
{ }
Container image for this instance. Set it from a pin file (kix.pins) so the deployed reference is committed and resolved.
-
Type:
submodule -
Default:
1{2digest = "sha256:0a9d8c8ddf34347eb59aad9a8784f0710de88d6d112726d11d271f9bc6daca26";3pullPolicy = "IfNotPresent";4repository = "docker.io/coredns/coredns";5tag = "1.15.0";6}
image.digest
Section titled “image.digest”Resolved manifest digest, sha256: followed by 64 hex characters. What will actually run. Null means not resolved.
- Type:
null or string - Default: the package’s digest while
tagis the package’s tag, otherwise null
image.note
Section titled “image.note”Whatever a person wanted to say about this pin. Kix never reads it and a promotion never discards it. Declared here for the same reason as the three fields above: a pin carries its own record-keeping, and the option accepts the whole pin rather than a subset of it.
- Type:
null or string - Default:
null
image.promotedBy
Section titled “image.promotedBy”Who resolved this pin, for the record. Null when unknown.
- Type:
null or string - Default:
null
image.pullPolicy
Section titled “image.pullPolicy”imagePullPolicy for containers using this image. Null leaves it to Kubernetes.
- Type:
null or string - Default:
"IfNotPresent"
image.repository
Section titled “image.repository”Image repository, registry host included.
- Type:
string - Default:
"docker.io/coredns/coredns"
image.resolvedAt
Section titled “image.resolvedAt”When this pin was resolved, RFC 3339. Null when unknown.
- Type:
null or string - Default:
null
image.sourceRev
Section titled “image.sourceRev”Revision of the source the image was built from, when Kix built it. Null for upstream images.
- Type:
null or string - Default:
null
image.tag
Section titled “image.tag”Image tag. What was asked for.
- Type:
string - Default:
"1.15.0"
metrics.enabled
Section titled “metrics.enabled”Enable metrics endpoint and monitoring resources (ServiceMonitor, PrometheusRules) when prometheus is available.
- Type:
boolean - Default:
true
metrics.interval
Section titled “metrics.interval”Scrape interval (e.g. ”30s”). Null = use Prometheus default.
- Type:
null or string - Default:
null
replicas
Section titled “replicas”CoreDNS replicas.
- Type:
positive integer, meaning >0 - Default: from the availability level: 1 at none, 2 above
resources
Section titled “resources”Container resource requests and limits. Each field keeps its default until set, and null removes a default.
-
Type:
submodule -
Default:
1{2limits = {3memory = "170Mi";4};5requests = {6cpu = "100m";7memory = "70Mi";8};9}
resources.claims
Section titled “resources.claims”Dynamic resource claims the container uses. Null leaves it unset.
- Type:
null or (list of (submodule)) - Default:
null
resources.claims.*.name
Section titled “resources.claims.*.name”Name of an entry in the pod’s resourceClaims.
- Type:
string
resources.claims.*.request
Section titled “resources.claims.*.request”Request within the claim to use. Null uses the whole claim.
- Type:
null or string - Default:
null
resources.limits
Section titled “resources.limits”Resource quantities by name.
- Type:
open submodule of attribute set of Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei) - Default:
{ }
resources.limits.cpu
Section titled “resources.limits.cpu”The cpu quantity. Null leaves it unset.
- Type:
null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei) - Default:
null
resources.limits.ephemeral-storage
Section titled “resources.limits.ephemeral-storage”The ephemeral-storage quantity. Null leaves it unset.
- Type:
null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei) - Default:
null
resources.limits.memory
Section titled “resources.limits.memory”The memory quantity. Null leaves it unset.
- Type:
null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei) - Default:
"170Mi"
resources.requests
Section titled “resources.requests”Resource quantities by name.
- Type:
open submodule of attribute set of Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei) - Default:
{ }
resources.requests.cpu
Section titled “resources.requests.cpu”The cpu quantity. Null leaves it unset.
- Type:
null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei) - Default:
"100m"
resources.requests.ephemeral-storage
Section titled “resources.requests.ephemeral-storage”The ephemeral-storage quantity. Null leaves it unset.
- Type:
null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei) - Default:
null
resources.requests.memory
Section titled “resources.requests.memory”The memory quantity. Null leaves it unset.
- Type:
null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei) - Default:
"70Mi"
servers
Section titled “servers”Corefile server blocks by name. Adding a block keeps default;
servers.default.plugins.<p>.enabled = false removes one plugin
from it, and servers.default.enabled = false removes the block.
Each default directive is set field by field, so overriding
kubernetes.args keeps its block.
Blocks render with those that enable view first, then by name.
CoreDNS answers from the first block sharing a zone and port whose
view matches, so name blocks with a prefix such as 10-office to
order them.
A plugin that reads a file (file, hosts) reads it from a key
added to the ConfigMap with partsOverlays on configmap, at
/etc/coredns/<key>.
The package allows DNS (53) in from every pod and out to resolvers
outside the cluster. Under network policy, a block on another port,
an upstream that is a pod, or a DoT or DoH upstream needs a policy
of its own: an entry in the cluster’s networkPolicy.platformIntents
that selects these pods (k8s-app: kube-dns), or a policy resource
added with partsOverlays.
-
Type:
attribute set of (submodule) -
Default:
One block,
servers.default, as kubeadm writes it:1.:53 {2cache 30 {3disable success <clusterDomain>4disable denial <clusterDomain>5}6errors7forward . <cluster.network.dnsUpstream, or /etc/resolv.conf> {8max_concurrent 10009}10health {11lameduck 5s12}13kubernetes <clusterDomain> in-addr.arpa ip6.arpa {14pods insecure15fallthrough in-addr.arpa ip6.arpa16ttl 3017}18loadbalance19loop20prometheus :915321ready22reload23} -
Example:
1{2default.plugins.forward.args = [ "." "192.0.2.53" ];3"10-office" = {4plugins.view.args = [ "office" ];5plugins.view.block = [ "expr incidr(client_ip(), '192.0.2.0/24')" ];6plugins.forward.args = [ "." "192.0.2.1" ];7};8}
servers.<name>.enabled
Section titled “servers.<name>.enabled”Whether the server block is rendered.
- Type:
boolean - Default:
true
servers.<name>.plugins
Section titled “servers.<name>.plugins”Directives of the block, keyed by a name of your choice, which is also the default plugin name. CoreDNS runs plugins in its compiled-in order whatever the Corefile says; repeats of one plugin run in attribute-name order.
- Type:
attribute set of (submodule) - Default:
{ }
servers.<name>.plugins.<name>.args
Section titled “servers.<name>.plugins.<name>.args”Arguments after the plugin name, one word each.
- Type:
list of string - Default:
[ ]
servers.<name>.plugins.<name>.block
Section titled “servers.<name>.plugins.<name>.block”Lines inside the directive’s { } block. Empty renders no block.
- Type:
list of string - Default:
[ ]
servers.<name>.plugins.<name>.enabled
Section titled “servers.<name>.plugins.<name>.enabled”Whether the directive is rendered.
- Type:
boolean - Default:
true
servers.<name>.plugins.<name>.name
Section titled “servers.<name>.plugins.<name>.name”The plugin the directive runs. Set it to repeat a plugin under another attribute, for example rewrite-a = { name = "rewrite"; args = [ ... ]; }.
- Type:
string - Default: the attribute name
servers.<name>.port
Section titled “servers.<name>.port”Port the block listens on, for every zone in its header.
- Type:
16 bit unsigned integer; between 0 and 65535 (both inclusive) - Default:
53
servers.<name>.zones
Section titled “servers.<name>.zones”Zones the block serves, such as . or example.org. The port goes
in port, not in the zone. A zone with a scheme (dns://,
tls://, https://, grpc://, or quic://) is refused: write a
plain DNS zone without one. A TLS server needs a certificate in the
pod and a Corefile block that servers does not build; add both
with partsOverlays on configmap and deployment.
-
Type:
non-empty (list of DNS zone name without a scheme or a :port suffix) -
Default:
1[2"."3]