This repository has been archived by the owner on Jun 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 672
Replace weave-local-pods ipset with physdev iptables rule #3423
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
by-pass ingress network policy chains and accept the packet if destination is not one of the local pods return the packets so the egress network policy chains are skipped in case packet's source is not one of the local pods Fixes #3344
bboreham
reviewed
Oct 5, 2018
prog/weave-npc/main.go
Outdated
if err := ipt.Append(npc.TableFilter, npc.MainChain, | ||
"-m", "state", "--state", "NEW", "-j", string(npc.DefaultChain)); err != nil { | ||
"-m", "physdev", "--physdev-out=vethwe-bridge", "-j", "ACCEPT"); err != nil { |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
prog/weave-npc/main.go
Outdated
@@ -179,7 +170,7 @@ func createBaseRules(ipt *iptables.IPTables, ips ipset.Interface) error { | |||
|
|||
ruleSpecs := [][]string{ | |||
{"-m", "state", "--state", "RELATED,ESTABLISHED", "-j", "ACCEPT"}, | |||
{"-m", "state", "--state", "NEW", "-m", "set", "!", "--match-set", npc.LocalIpset, "src", "-j", "RETURN"}, | |||
{"-m", "physdev", "--physdev-in=vethwe-bridge", "-j", "RETURN"}, |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
brb
reviewed
Oct 9, 2018
prog/weave-npc/main.go
Outdated
@@ -127,7 +128,7 @@ func createBaseRules(ipt *iptables.IPTables, ips ipset.Interface) error { | |||
|
|||
// If the destination address is not any of the local pods, let it through | |||
if err := ipt.Append(npc.TableFilter, npc.MainChain, | |||
"-m", "physdev", "--physdev-out=vethwe-bridge", "-j", "ACCEPT"); err != nil { | |||
"-m", "physdev", "--physdev-out="+bridgeName, "-j", "ACCEPT"); err != nil { |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
Addressed all comments. PTAL |
bboreham
approved these changes
Oct 17, 2018
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. One small niggle about the error message.
prog/weave-npc/main.go
Outdated
// delete `weave-local-pods` ipset which is no longer used by weave-npc | ||
weaveLocalPodExist, err := ipsetExist(ips, npc.LocalIpset) | ||
if err != nil { | ||
common.Log.Errorf("Failed to destroy ipset '%s'", npc.LocalIpset) |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
bboreham
approved these changes
Oct 17, 2018
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
by-pass ingress network policy chains and accept the packet if
destination is not one of the local pods
return the packets so the egress network policy chains are skipped
in case packet's source is not one of the local pods
Fixes #3344