Change:
<ins> /* Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package metaproxier import ( "reflect" "testing" v1 "k8s.io/api/core/v1" ) func Test_endpointsIPFamily(t *testing.T) { ipv4 := v1.IPv4Protocol ipv6 := v1.IPv6Protocol tests := []struct { name      string endpoints *v1.Endpoints want      *v1.IPFamily wantErr   bool errorMsg  string }{ { name:      "Endpoints No Subsets", endpoints: &v1.Endpoints{}, want:      nil, wantErr:   true, errorMsg:  "failed to identify ipfamily for endpoints (no subsets)", }, { name:      "Endpoints No Addresses", endpoints: &v1.Endpoints{Subsets: []v1.EndpointSubset{{NotReadyAddresses: []v1.EndpointAddress{}}}}, want:      nil, wantErr:   true, errorMsg:  "failed to identify ipfamily for endpoints (no addresses)", }, { name:      "Endpoints Address Has No IP", endpoints: &v1.Endpoints{Subsets: []v1.EndpointSubset{{Addresses: []v1.EndpointAddress{{Hostname: "testhost", IP: ""}}}}}, want:      nil, wantErr:   true, errorMsg:  "failed to identify ipfamily for endpoints (address has no ip)", }, { name:      "Endpoints Address IPv4", endpoints: &v1.Endpoints{Subsets: []v1.EndpointSubset{{Addresses: []v1.EndpointAddress{{IP: "1.2.3.4"}}}}}, want:      &ipv4, wantErr:   false, }, { name:      "Endpoints Address IPv6", endpoints: &v1.Endpoints{Subsets: []v1.EndpointSubset{{Addresses: []v1.EndpointAddress{{IP: "2001:db9::2"}}}}}, want:      &ipv6, wantErr:   false, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { got, err := endpointsIPFamily(tt.endpoints) if (err != nil) != tt.wantErr { t.Errorf("endpointsIPFamily() error = %v, wantErr %v", err, tt.wantErr) return } if err != nil && err.Error() != tt.errorMsg { t.Errorf("endpointsIPFamily() error = %v, wantErr %v", err, tt.errorMsg) return } if !reflect.DeepEqual(got, tt.want) { t.Errorf("endpointsIPFamily() = %v, want %v", got, tt.want) } }) } } </ins>

Discussion:
<!-- Please use this template while reporting a bug and provide as much info as possible. Not doing so may result in your bug not being addressed in a timely manner. Thanks! If the matter is security related, please disclose it privately via --What happened: Setup a kubernetes cluster with dual stack enabled, set kube-proxy to "ipvs" proxy mode, many warnings are flooding in kube-proxy pod log, W0303 22:11:22. 1 ] failed to update endpoints kube-system/kube-scheduler with error failed to identify ipfamily for endpoints (no subsets) W0303 22:11:22. 1 ] failed to update endpoints kube-system/kube-controller-manager with error failed to identify ipfamily for endpoints (no subsets) W0303 22:11:24. 1 ] failed to update endpoints kube-system/kube-scheduler with error failed to identify ipfamily for endpoints (no subsets) W0303 22:11:24. 1 ] failed to update endpoints kube-system/kube-controller-manager with error failed to identify ipfamily for endpoints (no subsets) W0303 22:11:26. 1 ] failed to update endpoints kube-system/kube-scheduler with error failed to identify ipfamily for endpoints (no subsets) What you expected to happen: No such error logs How to reproduce it (as minimally and precisely as possible): Here is my setup step, I'm using a single master node setup, kubeadm init --pod-network-cidr=192.168.0.0/16,fc00::/112 --service-cidr=10.96.0.0/16,fd00::/112 --feature-gates=IPv6DualStack=true Change controller-manager cidr configuration --node-cidr-mask-size-ipv6=120 install calico 3.6.4 with dual stack enabled kube-proxy proxy mode set to "ipvs" featureGates: IPv6DualStack: true healthzBindAddress: "" hostnameOverride: "" iptables: masqueradeAll: false masqueradeBit: null minSyncPeriod: 0s syncPeriod: 0s ipvs: excludeCIDRs: null minSyncPeriod: 0s scheduler: "" strictARP: false syncPeriod: 0s kind: KubeProxyConfiguration metricsBindAddress: "" mode: "ipvs" Anything else we need to know?

: Linux Redhat 7.7 Environment: Kubernetes version (use ):v1.17.3 Cloud provider or hardware configuration: OS (e.g: ): Redhat 7.7 Kernel (e.g. ): 3.10.0-1062.4.1.el7.x8664 Install tools: kubeadm Network plugin and version (if this is a network-related bug): calico 3.6.4 Others:
/sig network
/triage unresolved Comment when the issue is assessed and confirmed. I am a bot run by vllry. ‍
/assign
/remove-triage unresolved those warnings are harmless because those objects doesn't have endpoints addresses, thus no IP family, as you can see below: however, I think that if there are no endpoint addresses we should skip instead of logging, what do you think ?
It seems these printouts can be caused by headless services, please see;
Can endpoints support dual stack? From my understanding, it cannot support dual stack in v1.17. Why kube-proxy will check another ipFamily which is not configured? Here is the endpoints info under default ns from my cluster,
Another observation about dual stack supporting is I don't see ipv6 interface address in node status. Here is my interface configuration, and here is pod configuration, I see kubelet has already set ipv6 network in podCIDRs
The is reported by if you specify . Currently kubelet does not report both ipv4 and ipv6 addresses, that is not implemented yet. But public clouds do not let report the node but defines them themselves. At least set both addresses. So it depends on your environment.
endpoints on services with ClusterIP services are single family, with the same IPFamily than the ClusterIP. However, you can create endpoints manually, not associated to a service, or to a headless service (ClusterIP=None) with a mix of families. You opened the issue asking why do you have these errors logs If you check the endpoints of the services mentioned in the logs there are no addresses, hence the kube-proxy logs a WARNING because is not able to identify the IP family. Technically the warning is correct, but I think that if there are no addresses we shouldn't log the warning.

In order to not convert this issue in a placeholder for dual stack let's try to stick to the topic, for more general things we have a #k8s-dual-stack channel in slack.
Ok, I understand what you mentioned. From the implementation, this log behavior is correct. The other problem is kube-proxy is constantly logging the same error.
I think (please somebody correct me if I'm wrong) this is because the endpoints are checked periodically, per the control-loop / reconcile paradigm that kubernetes uses, so it tries to add those endpoints periodically
nodeIPs are only dual stack if the cloud-controller-manager updates it, on bare metal or without cloud-controller-manager you only see one address. I tried cloud-controller-manager in my openstack cluster and can get ipv4/ipv6 interface.
Thanks, I will create another issue for document.