Large clusters run out of IPv4 addresses Public IPv4 addresses are exhausted, and even private ranges run short at scale. Every node takes a whole Pod subnet (a /24 by default for IPv4), so a few hundred nodes can use up a large private block that also has to stay clear of the company network.
IPv6 has room to spare: each node gets a /64 by default, far more addresses than it will ever need. Dual-stack lets you add IPv6 while everything that only speaks IPv4 keeps working.
The control plane gets one range per family Dual-stack is stable since Kubernetes 1.23. kube-apiserver takes --service-cluster-ip-range with an IPv4 and an IPv6 CIDR, separated by a comma. kube-controller-manager takes --cluster-cidr for Pods, plus --service-cluster-ip-range, and gives each node one Pod CIDR per family.
kube-proxy also needs both ranges in --cluster-cidr. On bare metal, kubelet needs --node-ip with both node addresses. On managed clusters you usually choose dual-stack when the cluster or subnet is created.
Key idea The first range listed decides the default family for Services. Pick it on purpose.
A dual-stack CNI gives each Pod two addresses The CNI plugin must support dual-stack. It assigns each Pod one IPv4 and one IPv6 address and sets up routes for both. If it only does IPv4, the IPv6 settings above do nothing for Pods.
The Pod shows both in status.podIPs. The older status.podIP field keeps only the first one, so tools that read only that field miss the second family.
A Service stays single-stack unless you ask If a Service does not set ipFamilyPolicy, Kubernetes sets it to SingleStack and gives it one ClusterIP from the first Service range. Existing Services keep working exactly as before.
So turning on dual-stack does not change any app by itself. Each Service opts in.
PreferDualStack or RequireDualStack, and ipFamilies order PreferDualStack gets both families when the cluster has them and falls back to one otherwise. RequireDualStack fails to create on a cluster without dual-stack. spec.clusterIPs then holds two addresses.
ipFamilies sets the order, for example [IPv6, IPv4]. The first family is the primary one and fills the legacy spec.clusterIP. You can add or remove the secondary family later, but you cannot change the primary family of an existing Service.
Key idea To flip the primary family, create a new Service. Changing SingleStack to PreferDualStack in place only adds the second address.
DNS answers with both record types For a dual-stack Service, cluster DNS returns an A record (IPv4) and an AAAA record (IPv6) for web.shop.svc.cluster.local. A single-stack Service has only one of the two.
The client resolver asks for both and gets two answers back. Which one it uses is up to the client library, not Kubernetes.
Good clients race both families Happy eyeballs (RFC 8305) starts with one family, usually IPv6, and tries the other after a short delay if the first is slow. The first connection that succeeds wins.
Not every client does this. Some try only the first address and wait for a full timeout when that path is broken, which looks like random slow requests.
Key idea If a dual-stack Service is slow from some clients only, test each family on its own: curl -4 and curl -6.
IPv6 egress, IPv6-only clusters and cloud load balancers A Pod with a non-routable IPv6 address needs IP masquerading or a proxy to reach the internet over IPv6, just like with IPv4. In an IPv6-only cluster, reaching an IPv4-only API also needs something like NAT64 with DNS64.
A LoadBalancer Service with PreferDualStack or RequireDualStack only gets both public addresses if the cloud provider supports dual-stack load balancers.
Watch out Check that the CNI, the cloud LB and the egress path all support IPv6 before you depend on it.
The app listens on IPv4 only The web container binds to 0.0.0.0:8080. That is every IPv4 address and no IPv6. Connections to the Pod's IPv6 address are refused, while IPv4 works, so the bug only shows for some clients.
Bind to [::] instead. On Linux, an IPv6 socket on [::] usually accepts IPv4 too (as IPv4-mapped addresses) unless the app or the system sets IPV6_V6ONLY.
Code that assumes an address looks like IPv4 Splitting host:port on the first colon, a regex for four dotted numbers, or a database column sized for 15 characters all break on fd00:10:244:1::7. IPv6 addresses in URLs and host:port strings need brackets, like [fd00::7]:8080.
Logs, allowlists and rate limiters that key on client IP need the same fix, or IPv6 clients pile into one bucket or get rejected.
Watch out Use the standard library to parse and join addresses (for example net.SplitHostPort or ipaddress) instead of string tricks.
Two families from the control plane to the app Dual-stack needs two ranges on the API server and controller manager, a CNI that hands out both families, and Services that opt in with ipFamilyPolicy. DNS then returns A and AAAA, and clients choose.
Most breakage is in the app or at the edges: IPv4-only listeners, IPv4 string parsing, and load balancers or egress paths without IPv6.
Summary Read status.podIPs on a Pod and spec.clusterIPs and spec.ipFamilies on a Service to see which families are really in use.