-
Notifications
You must be signed in to change notification settings - Fork 674
race between weave-kube and kube-proxy can allow all traffic through Service VIP #3230
Comments
@brb is this still a problem? I would like to take a shot at this. |
@murali-reddy I think this is still a problem. I'd be interested in the "Monitor (and maintain) iptables rules and ensure the required order" solution, as it could be used to maintain other iptables rules installed by Net. Before implementing it, perhaps you could present possible ideas. |
One pattern i have seen with Kubernetes controllers is that idea of periodic reconciliation loop which ensures actual state is in sync with desired state. Such reconciliation even can fix out-of-band changes like iptables restart etc and issues as mentioned in #3155, #3106. But that is more significant work but holistic solution IMO. I still don't have good clarity how much of the code (both net and npc) is idempotent. I will look for other alternatives as well.
By |
I meant what you just described above, i.e. the way k8s does. |
Still a problem, currently worked around by modifying the kube-proxy service to remove weave iptables rules in ExecStartPre and remove weave containers in ExecStartPost for now. |
kube-proxy pre-appends the iptables rule "-j KUBE-FORWARD" which ACCEPTs all traffic and prevents it entering the "WEAVE-NPC" chain.
In #3210 we introduced a fix which pre-appends "-j WEAVE-NPC" after kube-proxy has inserted "-j KUBE-FORWARD". The fix relies on a premise that weave-kube is started after kube-proxy which follows from a fact that weave-kube depends on api-server (to get a peer list) and api-server is accessible to weave-kube only after kube-proxy has inserted all nat rules.
However, if the nat rules for api-server are present (e.g. from previous k8s installation which failed to flush them), then weave-kube can start before kube-proxy, and thus the WEAVE-NPC rule will be preceded by the KUBE-FORWARD => all traffic will be enabled to Pods through Service Virtual IP.
(Maybe) possible fixes to the problem:
weave-kube/launch.sh
to ensure that kube-proxy is running.The text was updated successfully, but these errors were encountered: