mirror of https://github.com/k3s-io/k3s
[kube-proxy/IPVS] Enforce ExternalTrafficPolicy:local even for services without affinity
parent
227893dc3d
commit
7092e2f9f4
|
@ -1008,11 +1008,9 @@ func (proxier *Proxier) syncProxyRules() {
|
||||||
serv.Timeout = uint32(svcInfo.StickyMaxAgeSeconds)
|
serv.Timeout = uint32(svcInfo.StickyMaxAgeSeconds)
|
||||||
}
|
}
|
||||||
if err := proxier.syncService(svcNameString, serv, true); err == nil {
|
if err := proxier.syncService(svcNameString, serv, true); err == nil {
|
||||||
// check if service need skip endpoints that not in same host as kube-proxy
|
|
||||||
onlyLocal := svcInfo.SessionAffinityType == v1.ServiceAffinityClientIP || svcInfo.OnlyNodeLocalEndpoints
|
|
||||||
activeIPVSServices[serv.String()] = true
|
activeIPVSServices[serv.String()] = true
|
||||||
activeBindAddrs[serv.Address.String()] = true
|
activeBindAddrs[serv.Address.String()] = true
|
||||||
if err := proxier.syncEndpoint(svcName, onlyLocal, serv); err != nil {
|
if err := proxier.syncEndpoint(svcName, svcInfo.OnlyNodeLocalEndpoints, serv); err != nil {
|
||||||
klog.Errorf("Failed to sync endpoint for service: %v, err: %v", serv, err)
|
klog.Errorf("Failed to sync endpoint for service: %v, err: %v", serv, err)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue