mirror of https://github.com/k3s-io/k3s
[kubeproxy/ipvs] New sysctls to improve pod termination
parent
b5615259e5
commit
1570d9f042
|
@ -162,6 +162,8 @@ const sysctlRouteLocalnet = "net/ipv4/conf/all/route_localnet"
|
|||
const sysctlBridgeCallIPTables = "net/bridge/bridge-nf-call-iptables"
|
||||
const sysctlVSConnTrack = "net/ipv4/vs/conntrack"
|
||||
const sysctlConnReuse = "net/ipv4/vs/conn_reuse_mode"
|
||||
const sysctlExpireNoDestConn = "net/ipv4/vs/expire_nodest_conn"
|
||||
const sysctlExpireQuiescentTemplate = "net/ipv4/vs/expire_quiescent_template"
|
||||
const sysctlForward = "net/ipv4/ip_forward"
|
||||
const sysctlArpIgnore = "net/ipv4/conf/all/arp_ignore"
|
||||
const sysctlArpAnnounce = "net/ipv4/conf/all/arp_announce"
|
||||
|
@ -321,6 +323,20 @@ func NewProxier(ipt utiliptables.Interface,
|
|||
}
|
||||
}
|
||||
|
||||
// Set the expire_nodest_conn sysctl we need for
|
||||
if val, _ := sysctl.GetSysctl(sysctlExpireNoDestConn); val != 1 {
|
||||
if err := sysctl.SetSysctl(sysctlExpireNoDestConn, 1); err != nil {
|
||||
return nil, fmt.Errorf("can't set sysctl %s: %v", sysctlExpireNoDestConn, err)
|
||||
}
|
||||
}
|
||||
|
||||
// Set the expire_quiescent_template sysctl we need for
|
||||
if val, _ := sysctl.GetSysctl(sysctlExpireQuiescentTemplate); val != 1 {
|
||||
if err := sysctl.SetSysctl(sysctlExpireQuiescentTemplate, 1); err != nil {
|
||||
return nil, fmt.Errorf("can't set sysctl %s: %v", sysctlExpireQuiescentTemplate, err)
|
||||
}
|
||||
}
|
||||
|
||||
// Set the ip_forward sysctl we need for
|
||||
if val, _ := sysctl.GetSysctl(sysctlForward); val != 1 {
|
||||
if err := sysctl.SetSysctl(sysctlForward, 1); err != nil {
|
||||
|
|
Loading…
Reference in New Issue