A kind cluster no longer copies the DNS search domains of the host into its nodes and pods (#271, #279). The new field spec.network.dnsSearch keeps the domains that a cluster needs. The change is in Go and in bash. Read Behaviour changes before you upgrade.
Behaviour changes
- The host DNS search domains stay out of kind clusters (#271). The kind config that lo renders now sets
networking.dnsSearch: []. The nodes and pods of a new cluster get no search domain from the host. The search list of a pod holds only the cluster domains. Short host names no longer resolve on the nodes either: image pulls (containerd resolves a registry host on the node) and pods withhostNetwork: true. Use the full name,dnsConfig.searchesfor one pod, orspec.network.dnsSearchfor the cluster (see Fixes). The field needs kind v0.18.0 or later.
Fixes
- The host DNS search domains stay out of kind nodes and pods (#271). Docker writes the
/etc/resolv.confof a kind node from the host and copies itssearchline, for examplesearch home.example corp.example.net. kubelet then added these domains to the search list of every pod, after the cluster domains, withndots:5. So a pod sent a query for each search domain before the real name. Resolvers with a fixed time budget (musl, hickory) then failed external names. For example, a static musl build of a CLI tool in a pod failed every request after 5 s.- The kind config now sets
networking.dnsSearch: []in both implementations. kind starts every node with an emptyKIND_DNS_SEARCH. The node entrypoint then removes the search lines from/etc/resolv.confon every boot, before kubelet starts. The nameserver stays the same. - The fix holds after a node restart, and it applies to every node of the cluster.
- Opt-out:
spec.network.dnsSearch. A cluster that must resolve short names of a company or home network lists the domains:yamlThe list replaces the empty default, as written. Each entry is a DNS name: letters in any case, digits, hyphens and dots, and an optional trailing dot. A label has at most 63 characters, the name at most 253. The list takes at most 32 entries, the Kubernetes limit for the search list of a pod.spec: network: dnsSearch: - corp.example.com - home.example lo upandlo lintrefuse a bad entry before lo creates anything. Each bad entry gets one error line that names the fix. The Lo CRD schema checks the field too.lo lint --notesnotes an explicitdnsSearch: [], which is the default.- In the bash implementation, each read of the list has a time limit of 10 s that needs no GNU
timeout, so it holds on macOS too. It also has a memory limit of 1 GiB (ulimit -d) where the operating system enforces it. Only a spec that setsdnsSearchneeds yq v4.47.1 or later. - In the bash implementation,
lo::read_configanddriver::exportnow stop at a failed read. Before, they printed the error and went on.
- The kind config now sets
- The default render works under
set -uon bash before 4.4 (#279). The bash render of the empty default list expanded an empty array without a guard. On bash 4.3 underset -u, that stopped every Lo provision withoutspec.network.dnsSearch. The render now uses the same guard as the reader.
Upgrade
- DNS search domains (#271). kind sets the search list when it creates the nodes. An existing cluster keeps the host search domains until you recreate it with
lo downandlo up. Addspec.network.dnsSearchfirst when the cluster needs short names. Check that your kind is v0.18.0 or later (kind version). - A project with its own bash tree in
.lok8s/(lo assets eject bash) runslo assets update bashto get the bash twin of the change.
Known limitations
- kind v0.18.0 or later (#271). An older kind binary stops at
kind createwith an unknown-field error. A node image from before kind v0.18.0 ignores the field, and its nodes keep the host search domains.lo doctordoes not check the kind version yet (#274).
Follow-up
- #274:
lo doctorchecks the minimum kind version (v0.18.0 fordnsSearch). - #277: one helper for the bounded yq reads of the bash implementation.
Commits
8f771e5fix(lo): keep the host's DNS search domains out of kind nodes and pods (#271)3a628c1fix(lo): guard the empty dnsSearch list under set -u on bash < 4.4 (#279)