Skip to content

hack/create-kind-cluster.sh: fix DNS on IPv6-only kind clusters - #958

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

hack/create-kind-cluster.sh: 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

Copy link
Copy Markdown
Collaborator

On a fresh IP_FAMILY=ipv6 cluster nothing resolves from inside a pod, so no actor ever boots. Two causes:

  • CoreDNS runs dnsPolicy: Default and inherits the node's Docker-generated /etc/resolv.conf, which always names an IPv4 resolver. Pods here have no IPv4 address, so every external lookup dies at connect: network is unreachable, and anything that fetches at runtime — atelet pulling the gVisor tarball, for one — never starts.
  • The script wires the registry into containerd on the node, which does not help a pod: atelet pulls actor images from its own netns, where kind-registry NXDOMAINs.

Two Corefile clauses fix both: a hosts block mapping kind-registry to the registry's IPv6 address, with fallthrough so every other name still reaches the forwarder, and a forward to an IPv6 upstream overridable via IPV6_DNS_UPSTREAM. The patch hard-fails if the substitution is a no-op — a silent no-op is the whole failure mode — and probes both names from a pod rather than the node, which is dual-stack and would resolve them either way.

Everything is inside if [[ "${IP_FAMILY}" == "ipv6" ]], so IPv4 and dual-stack clusters are unchanged.

Stacked on #877 for the IP_FAMILY knob. GitHub will not accept a base branch that lives only in a fork, so this targets main and #877's commit rides along in the diff. Do not merge before #877.

Verified by the IPv6-only e2e job in #939: full control-plane install plus the demo and networking suites on a v6-only cluster.

Part of #246.

IP_FAMILY selects ipv4, ipv6 or dual and becomes networking.ipFamily, leaving
kind's per-family subnet defaults alone. The script also recreates a pre-IPv6
"kind" Docker network, fails fast if the daemon has IPv6 off, sets proxy_ndp
alongside proxy_arp for gVisor pod-to-pod traffic, and repoints an ipv6
kubeconfig from [::1] at localhost so a client outside the Docker host can
still reach the apiserver.

Tested on kind with all three families: node InternalIPs, Service ClusterIPs
and pod IPs land in the requested families, pod-to-pod and CoreDNS work on
them, and pods still pull through the local registry.
CoreDNS runs dnsPolicy: Default and inherits the node's Docker-generated
/etc/resolv.conf, which always names an IPv4 resolver -- unreachable from a
v6-only pod, so every external lookup dies at "connect: network is
unreachable". Behind that sits a second failure: this script wires the
registry into containerd on the node, but atelet pulls actor images from its
own pod netns, where kind-registry does not resolve at all.

Rewrite the Corefile on IPv6-only clusters: a hosts block mapping
kind-registry to the registry's GlobalIPv6Address, with fallthrough so
non-registry names still reach the new IPv6 forwarder. Hard-fail if the
substitution was a no-op, and probe both names from a pod rather than the
node, which is dual-stack and would resolve them either way.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant