Skip to content

hack: fix DNS on IPv6-only kind clusters - #958

Open
Yuan Gao (ygao-g) wants to merge 2 commits into
agent-substrate:mainfrom
ygao-g:kind-ipv6-coredns
Open

hack: fix DNS on IPv6-only kind clusters#958
Yuan Gao (ygao-g) wants to merge 2 commits into
agent-substrate:mainfrom
ygao-g:kind-ipv6-coredns

Conversation

@ygao-g

@ygao-g Yuan Gao (ygao-g) commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

An IPv6-only kind cluster is unusable today:

  1. the script corrupts the kubeconfig kind wrote by changing https://[::1]:PORT to https://localhost:PORT;
  2. nothing resolves from inside a pod.

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

@ygao-g
Yuan Gao (ygao-g) force-pushed the kind-ipv6-coredns branch 2 times, most recently from 45bac3d to ecf1fc6 Compare August 18, 2026 16:00
@ygao-g Yuan Gao (ygao-g) changed the title hack/create-kind-cluster.sh: fix DNS on IPv6-only kind clusters hack: fix DNS on IPv6-only kind clusters Aug 18, 2026
@ygao-g
Yuan Gao (ygao-g) force-pushed the kind-ipv6-coredns branch 3 times, most recently from e812e99 to 3350f55 Compare August 18, 2026 22:07
@ygao-g Yuan Gao (ygao-g) added kind/bug Something isn't working / bugfixes area/network labels Aug 18, 2026
@ygao-g
Yuan Gao (ygao-g) marked this pull request as ready for review August 19, 2026 00:32
@ygao-g

Yuan Gao (ygao-g) commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator Author

Testing

Manual Testing: IP_FAMILY=ipv6 hack/create-kind-cluster.sh--deploy-ate-system--deploy-demo-counter: atelet pulls the gVisor tarball from storage.googleapis.com over IPv6 from its own pod netns, the actor image pulls through kind-registry, and a golden actor runs and checkpoints.

CI has no IPv6 job and this PR does not add one — #1065 is a signal-only draft that produces that coverage on demand.

@ygao-g
Yuan Gao (ygao-g) force-pushed the kind-ipv6-coredns branch 11 times, most recently from beb7dc6 to a0b159f Compare August 27, 2026 16:41
Comment thread hack/create-kind-cluster.sh Outdated
Comment thread hack/create-kind-cluster.sh Outdated
Comment thread hack/create-kind-cluster.sh

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@ygao-g
Yuan Gao (ygao-g) marked this pull request as draft August 28, 2026 16:14
@ygao-g Yuan Gao (ygao-g) changed the title hack: fix DNS on IPv6-only kind clusters [WIP] hack: fix DNS on IPv6-only kind clusters Aug 28, 2026
@ygao-g Yuan Gao (ygao-g) changed the title [WIP] hack: fix DNS on IPv6-only kind clusters hack: fix DNS on IPv6-only kind clusters Aug 28, 2026
@ygao-g
Yuan Gao (ygao-g) marked this pull request as ready for review August 28, 2026 16:17
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/network kind/bug Something isn't working / bugfixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants