mirror of
https://github.com/cloudnativelabs/kube-router.git
synced 2025-10-07 07:51:26 +02:00
Flush conntrack entry when UDP service endpoint is deleted (#259)
Fixes #157 kubernetes/kubernetes#19029 kubernetes/kubernetes#22573
This commit is contained in:
parent
8ce5e4fe3d
commit
94a2ec7e17
@ -11,6 +11,7 @@ RUN apk add --no-cache \
|
||||
ipset \
|
||||
iproute2 \
|
||||
ipvsadm \
|
||||
conntrack-tools \
|
||||
curl \
|
||||
bash && \
|
||||
mkdir -p /var/lib/gobgp && \
|
||||
|
@ -537,6 +537,15 @@ func (nsc *NetworkServicesController) syncIpvsServices(serviceInfoMap serviceInf
|
||||
glog.Errorf("Failed to delete destination %s from ipvs service %s",
|
||||
ipvsDestinationString(dst), ipvsServiceString(ipvsSvc))
|
||||
}
|
||||
|
||||
// flush conntrack when endpoint for a UDP service changes
|
||||
if ipvsSvc.Protocol == syscall.IPPROTO_UDP {
|
||||
_, err := exec.Command("conntrack", "-D", "--orig-dst", dst.Address.String(), "-p", "udp", "--dport", strconv.Itoa(int(dst.Port))).Output()
|
||||
if err != nil {
|
||||
glog.Error("Failed to delete conntrack entry for endpoint: " + dst.Address.String() + ":" + strconv.Itoa(int(dst.Port)) + " due to " + err.Error())
|
||||
}
|
||||
glog.Infof("Deleted conntrack entry for endpoint: " + dst.Address.String() + ":" + strconv.Itoa(int(dst.Port)))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user