hack: fix DNS on IPv6-only kind clusters - #958
Conversation
45bac3d to
ecf1fc6
Compare
e812e99 to
3350f55
Compare
3350f55 to
302995d
Compare
302995d to
e336c22
Compare
TestingEach check is paired with a control that must fail — the failure mode this guards against is a probe that passes without proving anything.
CI has no IPv6 job and this PR does not add one — #939 is a signal-only draft that produces that coverage on demand. |
533811a to
0212c2c
Compare
0212c2c to
e5e975d
Compare
9cc9703 to
3dbf64b
Compare
|
Ping — this one is a two-file Worth knowing that the branch has moved since it was last looked at. Two commits went on, both fixes for defects I hit while trying to run it rather than responses to review: the DNS gate was reporting green with one of kind's two CoreDNS replicas unable to resolve, and the IPv6-only kubeconfig repoint was replacing a working apiserver address with a refused one on a native-Linux Docker host, which killed every |
kind writes an IPv6 kubeconfig pointing at [::1] and the script rewrote it to localhost unconditionally, for the VM-hosted-daemon case where the port is forwarded to the v4 loopback. On a native Linux daemon [::1] already works and localhost is not a name for it -- Debian gives ::1 the names ip6-localhost and ip6-loopback -- so the rewrite traded a working address for a refused one and every later kubectl in the script died at connect. It now probes [::1], falls back to localhost only if that fails, and errors if neither answers, so a transient apiserver hiccup cannot strand the kubeconfig on an address that never worked. First of two commits fixing IPv6-only kind bring-up.
On a fresh IP_FAMILY=ipv6 cluster nothing resolves from inside a pod and no actor boots: CoreDNS runs dnsPolicy: Default and inherits the node's IPv4 resolver, which a v6-only pod cannot reach. Two Corefile clauses fix it -- a forward to an IPv6 upstream, overridable with IPV6_DNS_UPSTREAM, and a hosts entry for the local registry, which step 3 wires into containerd on the node but atelet pulls from its own pod netns. IPv4 and dual-stack pods reach both names through kind's own DNS translation, so this is gated on ipv6 and those families are untouched. A probe pod checks both legs before the script exits, because a silent misconfiguration here does not surface until an actor fails to boot much later. Second of two commits fixing IPv6-only kind bring-up.
989934e to
1a4616f
Compare
Part of #246.
IPV6_DNS_UPSTREAMknob is documented in the script's--help)On a fresh
IP_FAMILY=ipv6cluster nothing resolves from inside a pod and no actor boots: CoreDNS runsdnsPolicy: Defaultand inherits the node's IPv4 resolver, which a v6-only pod cannot reach. Two Corefile clauses fix it — aforwardto an IPv6 upstream, overridable withIPV6_DNS_UPSTREAM, and ahostsentry forkind-registry, which step 3 wires into containerd on the node but atelet pulls from its own pod netns. IPv4 and dual-stack pods reach both names through kind's own DNS translation, so this is gated onipv6and those families are untouched.A probe pod checks both legs before the script exits, so a misconfiguration is named here rather than surfacing much later as an actor that will not boot. The first commit is a prerequisite: on a native Linux daemon the old unconditional kubeconfig rewrite traded a working
[::1]for a refusedlocalhost.No CI lane covers this (#939 is gated on this PR), so it was checked by hand: four consecutive clean
ipv6bring-ups, three negative controls that each exit 1 with their own message (unreachable upstream, unpatched Corefile, stale registry address), and anipv4run confirming the Corefile is left alone.atenet-egressstill crashloops on v6-only, for an unrelated Envoy bind bug.🤖 Generated with Claude Code