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
TestingManual Testing: CI has no IPv6 job and this PR does not add one — #1065 is a signal-only draft that produces that coverage on demand. |
533811a to
0212c2c
Compare
0212c2c to
e5e975d
Compare
9cc9703 to
3dbf64b
Compare
beb7dc6 to
a0b159f
Compare
a0b159f to
a22c540
Compare
a22c540 to
f3e7447
Compare
Benjamin Elder (BenTheElder)
left a comment
There was a problem hiding this comment.
Bowei Du (@bowei) we're going to have to rewrite this in go too, sigh
this is meant to represent a portable cluster, if we customize it heavily then we're really not proving substrate works generically
can we please file upstream issues with the relevant projects for each thing we're working around, so we can actually fix them?
f3e7447 to
c711eca
Compare
On an IPv6-only cluster the script rewrote kind's `https://[::1]:PORT` kubeconfig entry to `https://localhost:PORT` unconditionally. That breaks any host whose `/etc/hosts` leaves `localhost` off the `::1` line, including the Ubuntu cloud image Lima runs: `localhost` resolves v4-only and every later kubectl fails at connect. The rewrite existed for one case, a macOS client reaching kind inside a Lima VM, where limactl re-forwards the published port to the host's v4 loopback only. Running the loop inside the guest reaches `[::1]` directly and avoids that path entirely.
On a fresh IPv6-only kind cluster nothing resolves from inside a pod, so the install never completes. CoreDNS inherits the node's IPv4 resolver, which a v6-only pod cannot reach, and the in-cluster registry has no name a pod can look up. This gives the cluster its own Corefile, gated on ipv6: a forward to an IPv6 upstream, overridable with IPV6_DNS_UPSTREAM, and a kind-registry:53 server block so atelet can pull from its own network namespace. The Corefile patch runs kubectl straight after `kind create`, which returns before the apiserver answers, so the script now waits for the control plane from inside the node first.
c711eca to
1cb5a78
Compare
An IPv6-only kind cluster is unusable today:
For 1., remove the overwrite, which is only needed for a macOS client reaching kind inside a Lima VM.
For 2., forward to a upstream IPv6 DNS upstream instead of the node's IPv4 resolver, and a kind-registry:53 server block so atelet can pull from its own
network namespace.
Verified in a Lima guest on mac OS. IP_FAMILY=ipv6 comes up clean; kind's untouched
https://[::1]:PORT answers ok; from a v6-only pod www.google.com,
kubernetes.default.svc.cluster.local and kind-registry. all resolve. IPv4 is
unaffected — the new block is gated on ipv6.
Part of #1099.
Part of #246.
🤖 Generated with Claude Code