-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should iptables be removed on container shutdown/removal? #44
Comments
I would like to reinforce this question with an example. I didn't noticed that running K8s with calico we need to use Than I fix my mistake, and deleted the old kube2iam Deamonset. But the iptables rule was not removed. So I tried to bring Kube2iam with
As I said, I didn't have any problems with the new Deamonset, but I think the better should be clean up the rule when we delete the deamonset. Also, I'm running version 0.2.2 because of this issue: #37 It would be great to have a solution for both problems. |
+1 I think this is a good idea. I had the same issues as @fwynyk and had to clean up iptables on every cluster node several times while troubleshooting the issue. |
When the container shuts down because of a crash/OOM then removing iptables rule would create a security issue. |
A crash wouldn't be able to remove anything anyway, would it? Also perhaps not an OOM? So as an attack vector a crash/oom would not work. And if installed as a daemonset a crash would force a restart. In case of a willful shutdown I would expect a service to return the system to its previous state. |
can we add logic at startup of the daemon to see if there are any iptables rules and clear them out, then we will be protected if the pod crashes or is killed by the k8s control plane. |
I have seen problems when we updated kube2iam in a cluster that has kube2iam running already, when a pod does not have an iam role associated kube2iam tries to proxy the calls to the metadata service, and I see http proxy context timeout and kube2iam was completely un-usable, what I think it happens is that the old rules are making kube2iam calls go to an inexistent pod. |
+1 on this, leaving a lingering iptables entry on the nodes when a kube2iam pod is deleted from a node can have some really terrible ramifications. |
Closing this, I am not using kube2iam any more and just want to clear up my "open issues" in GitHub. |
When the container shuts down should the iptables rule be reverted?
The text was updated successfully, but these errors were encountered: