You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a Kubernetes environment, using containerd, when a pod is deleted the portmap plugin is executed at least 3 times, despite it does not have portmaps configured. This has some consequences, because portmap executes iptables and ip6tables, that means that we hold the iptables lock at least 6 times.
how to repro
Create a Kubernetes deployment, i.e. kind create cluster
move the portmap plugin to portmap.bin
create a wrapper script to log the calls to the plugin
/opt/cni/bin/portmap
#!/bin/shecho$(date +"%T")>> /tmp/debug_portmap
echo"CNI: $CNI_COMMAND$CNI_IFNAME$CNI_NETNS$CNI_CONTAINERID">> /tmp/debug_portmap
tee -a /tmp/debug_portmap | /opt/cni/bin/portmap.bin
echo"\n---------------">> /tmp/debug_portmap
create a pod kubectl run nginx --image=nginx --port=80
if we log the number of iptables called issued using a tool like execsnoop, we can see that the portmap plugin executes multiples iptables and ip6tables calls using the --wait flag without any timeout, that means wait forever (ref coreos/go-iptables#75)
In a Kubernetes environment, using containerd, when a pod is deleted the portmap plugin is executed at least 3 times, despite it does not have portmaps configured. This has some consequences, because portmap executes iptables and ip6tables, that means that we hold the iptables lock at least 6 times.
how to repro
Create a Kubernetes deployment, i.e.
kind create cluster
kubectl run nginx --image=nginx --port=80
kubectl delete deployment nginx
So far, we see that our portmap plugin is called despite there is no hostPorts, let's create a pod with hostPorts
we can observe that is executed one time more with a delay
so, it seems containerd tears down the network multiple times
full log here
https://pastebin.com/9d83jMvj
if we log the number of iptables called issued using a tool like
execsnoop
, we can see that the portmap plugin executes multiplesiptables
andip6tables
calls using the--wait
flag without any timeout, that means wait forever (ref coreos/go-iptables#75)xref: kubernetes/kubernetes#92811 (comment)
The text was updated successfully, but these errors were encountered: