Skip to content
This repository was archived by the owner on Jun 20, 2024. It is now read-only.
This repository was archived by the owner on Jun 20, 2024. It is now read-only.

race between weave-kube and kube-proxy can allow all traffic through Service VIP #3230

Open
@brb

Description

@brb

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:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions