Change:
What happened: For services with type NodePort (and LoadBalancer) ipvs entries for localhost (ipv4 and ipv6) are created. Here is an example for a service with so the same nodeport is used for ipv4 and ipv6; The localhost entries can't be used and most likely they never will. What you expected to happen: Since "::1" most likely will never work and 127.0.0.1 will not work without an unlikely Linux kernel update these entries must not be created. Further, since the use of localhost addresses for nodeports is the only know reason to require (), this requirement shall be removed for proxy-mode=ipvs. How to reproduce it (as minimally and precisely as possible): Start a cluster with proxy-mode=ipvs and some services Do; Anything else we need to know?: That ipv6 access to [::1]:nodeport does not work (and most likely never will) is discussed in For 127.0.0.1 is is a bit more complicated as discussed in , with the excellent deep-dive into the kernel by in This may seem like a minor issue but clean-up of useless things is always good. I also have (vague) plans to propose improvements for the address handling for proxy-mode=ipvs and the localhost entries becomes an unwanted problem. If this issue is accepted as a bug I'll be happy to do a PR. Environment: Kubernetes version (use ): all supporting proxy-mode=ipvs Cloud provider or hardware configuration: any OS (e.g: ): any Kernel (e.g. ): any Install tools: none Network plugin and version (if this is a network-related bug): any Others: /kind cleanup /sig network /area ipvs
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the label and provide further guidance. The label can be by org members by writing in a comment. <detailsInstructions for interacting with me using PR comments are available . If you have questions or suggestions related to my behavior, please file an issue against the repository. </details
test in ipv6 + iptables , ::1 is not work for NodePort. /assign
Issues go stale after 90d of inactivity. Mark the issue as fresh with . Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with . Send feedback to sig-contributor-experience at . /lifecycle stale
/area kube-proxy
/remove lifecycle-stale
/remove-lifecycle stale <sigh...
Since it is highly unlikely that the kernel will be updated to allow this for ipv4 and it will never work for ipv6 I would really want to remove this from the ipvs proxier.
Do you think I can go ahead and disable the setup for localhost node-ports in the ipvs proxier? Since it have never worked it would not be a user facing change. Or should we discuss it on the sig/network meeting?
I personally think that this was implicitly discussed and confirmed here , it is an implementation detail of IPVS and a known issue that never worked in IPVS, so it will be safe to disable directly without further discussion. However, I defer to for a final decision /assign
I made a PR. ~It's just 3 lines~ Now 8 lines. I forgot the config setting.

Discussion:
// 172.17.0.1 dev docker0  scope host  src 172.17.0.1 // 192.168.122.1 dev virbr0  scope host  src 192.168.122.1 // Then filter out dev==kube-ipvs0, and cut the unique src IP fields, <del> // Node IP set: [100.106.89.164, 127.0.0.1, 172.17.0.1, 192.168.122.1] </del> <ins> // Node IP set: [100.106.89.164, 172.17.0.1, 192.168.122.1] // Note that loopback addresses are excluded. </ins> func (r *realIPGetter) NodeIPs() (ips []net.IP, err error) { // Pass in empty filter device name for list all LOCAL type addresses. nodeAddress, err := r.nl.GetLocalAddresses("", DefaultDummyDevice)

} // translate ip string to IP for _, ipStr := range nodeAddress.UnsortedList() { <del> ips = append(ips, net.ParseIP(ipStr)) </del> <ins> a := net.ParseIP(ipStr) if a.IsLoopback() { continue } ips = append(ips, a) </ins> } return ips, nil }

} else { nodeAddresses = nodeAddrSet.List() for _, address := range nodeAddresses { <ins> a := net.ParseIP(address) if a.IsLoopback() { continue } </ins> if utilproxy.IsZeroCIDR(address) { nodeIPs, err = proxier.ipGetter.NodeIPs() if err != nil {

} break } <del> nodeIPs = append(nodeIPs, net.ParseIP(address)) </del> <ins> nodeIPs = append(nodeIPs, a) </ins> } } }

// case 0 { devAddresses: map[string][]string{"eth0": {"1.2.3.4"}, "lo": {"127.0.0.1"}}, <del> expectIPs:    []string{"1.2.3.4", "127.0.0.1"}, </del> <ins> expectIPs:    []string{"1.2.3.4"}, </ins> }, // case 1 { devAddresses: map[string][]string{"lo": {"127.0.0.1"}}, <del> expectIPs:    []string{"127.0.0.1"}, </del> <ins> expectIPs:    []string{}, </ins> }, // case 2 {

// case 3 { devAddresses: map[string][]string{"encap0": {"10.20.30.40"}, "lo": {"127.0.0.1"}, "docker0": {"172.17.0.1"}}, <del> expectIPs:    []string{"10.20.30.40", "127.0.0.1", "172.17.0.1"}, </del> <ins> expectIPs:    []string{"10.20.30.40", "172.17.0.1"}, </ins> }, // case 4 { devAddresses: map[string][]string{"encaps9": {"10.20.30.40"}, "lo": {"127.0.0.1"}, "encap7": {"10.20.30.31"}}, <del> expectIPs:    []string{"10.20.30.40", "127.0.0.1", "10.20.30.31"}, </del> <ins> expectIPs:    []string{"10.20.30.40", "10.20.30.31"}, </ins> }, // case 5 { devAddresses: map[string][]string{"kube-ipvs0": {"1.2.3.4"}, "lo": {"127.0.0.1"}, "encap7": {"10.20.30.31"}}, <del> expectIPs:    []string{"127.0.0.1", "10.20.30.31"}, </del> <ins> expectIPs:    []string{"10.20.30.31"}, </ins> }, // case 6 { devAddresses: map[string][]string{"kube-ipvs0": {"1.2.3.4", "2.3.4.5"}, "lo": {"127.0.0.1"}}, <del> expectIPs:    []string{"127.0.0.1"}, </del> <ins> expectIPs:    []string{}, </ins> }, // case 7 {

// case 8 { devAddresses: map[string][]string{"kube-ipvs0": {"1.2.3.4", "2.3.4.5"}, "eth5": {"3.4.5.6"}, "lo": {"127.0.0.1"}}, <del> expectIPs:    []string{"127.0.0.1", "3.4.5.6"}, </del> <ins> expectIPs:    []string{"3.4.5.6"}, </ins> }, // case 9 { devAddresses: map[string][]string{"ipvs0": {"1.2.3.4"}, "lo": {"127.0.0.1"}, "encap7": {"10.20.30.31"}}, <del> expectIPs:    []string{"127.0.0.1", "10.20.30.31", "1.2.3.4"}, </del> <ins> expectIPs:    []string{"10.20.30.31", "1.2.3.4"}, </ins> }, }