Change:
}, }, }, <ins> { name: "spec:v6 ip:v6 dualstack:off isIPv6Primary:true", isIPv6Primary:          true, specExpctPrimary:       true, clusterIPExpectPrimary: true, enableDualStack:        false, svc: &api.Service{ ObjectMeta: metav1.ObjectMeta{Name: "foo", ResourceVersion: "1"}, Spec: api.ServiceSpec{ Selector:  map[string]string{"bar": "baz"}, Type:      api.ServiceTypeClusterIP, IPFamily:  &ipv6Service, ClusterIP: "2000::1", }, }, }, { name: "spec:v6 ip:v6 dualstack:on isIPv6Primary:true", isIPv6Primary:          true, specExpctPrimary:       true, clusterIPExpectPrimary: true, enableDualStack:        true, svc: &api.Service{ ObjectMeta: metav1.ObjectMeta{Name: "foo", ResourceVersion: "1"}, Spec: api.ServiceSpec{ Selector:  map[string]string{"bar": "baz"}, Type:      api.ServiceTypeClusterIP, IPFamily:  &ipv6Service, ClusterIP: "2000::1", }, }, }, { name: "spec:v6 ip:v4 dualstack:on isIPv6Primary:true", isIPv6Primary:          true, specExpctPrimary:       true, clusterIPExpectPrimary: false, enableDualStack:        true, svc: &api.Service{ ObjectMeta: metav1.ObjectMeta{Name: "foo", ResourceVersion: "1"}, Spec: api.ServiceSpec{ Selector:  map[string]string{"bar": "baz"}, Type:      api.ServiceTypeClusterIP, IPFamily:  &ipv6Service, ClusterIP: "10.0.0.1", }, }, }, { name: "spec:v4 ip:v4 dualstack:on isIPv6Primary:true", isIPv6Primary:          true, specExpctPrimary:       false, clusterIPExpectPrimary: false, enableDualStack:        true, svc: &api.Service{ ObjectMeta: metav1.ObjectMeta{Name: "foo", ResourceVersion: "1"}, Spec: api.ServiceSpec{ Selector:  map[string]string{"bar": "baz"}, Type:      api.ServiceTypeClusterIP, IPFamily:  &ipv4Service, ClusterIP: "10.0.0.1", }, }, }, { name: "spec:v4 ip:v6 dualstack:on isIPv6Primary:true", isIPv6Primary:          true, specExpctPrimary:       false, clusterIPExpectPrimary: true, enableDualStack:        true, svc: &api.Service{ ObjectMeta: metav1.ObjectMeta{Name: "foo", ResourceVersion: "1"}, Spec: api.ServiceSpec{ Selector:  map[string]string{"bar": "baz"}, Type:      api.ServiceTypeClusterIP, IPFamily:  &ipv4Service, ClusterIP: "2000::1", }, }, }, </ins> } for _, tc := range testCases {

Discussion:
What happened: When K8s is started in dual-stack mode with IPv6 as the "main" (or base) family services specified with ipFamily:IPv4 still get a ipv6 ; The is expicitly set to "10.0.0.0" using . What you expected to happen: Services with ipFamily:IPv4 shall get ipv4 ClusterIP addresses. How to reproduce it (as minimally and precisely as possible): Setup a K8s cluster in dual-stack mode with family IPv6 as base Define a service with ipFamily: IPv4 To make K8s think IPv6 is the main family the cue is to define ipv6 addresses to K8s binaries. Below are my settings as an example. I do not use but install "from scratch"; Master processes; is accessed with ipv4 which does not affect the K8s family. Worker processes; Anything else we need to know?: There are other problems with dual-stack/ipv6-base but may be caused by this one. For example does not work and some processes does not become "ready". Ipv6 traffic to ipv6 services and DNS works; Environment: Kubernetes version (use ):Cloud provider or hardware configuration: - OS (e.g: ): BusyBox based own setup. Kernel (e.g. ):Install tools: "from scratch" Network plugin and version (if this is a network-related bug): Others:
/sig network /cc
The problem seem to be; The problem occurs when an ipv6 range is specified first, even in an ipv4-based dual-stack cluster. But the ipv6 range must be specified first otherwise the "kubernetes" service gets an ipv4 address but an ipv6 backend; ~Perhaps the way to fix this problem is to make sure the service address is from the right family and require that the order to is "ipv4,ipv6".~ Bad idea!
There seem to be a option; But I can't see it in the help printout. I will try to use it...
:disappointed:
Here it where the kubernetes service address is set;
/assign
/triage unresolved Comment when the issue is assessed and confirmed. I am a bot run by vllry. ‍