-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Felix programs in-cluster no encapsulation routes #10472
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
base: master
Are you sure you want to change the base?
Conversation
|
||
// No encap routing tests. BrokenXSum is irrelevant in these cases. | ||
{api.IPIPModeNever, "CalicoIPAM", false}, | ||
{api.IPIPModeNever, "WorkloadIPs", false}, |
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.
These tests are moved from file fv/ipip_test.go
and some adjustments are made for no-encap tests.
The above two cases, are basically running the same test cases for no-encap routing.
return out | ||
}, "10s", "100ms").Should(ContainSubstring("tx-checksumming: on")) | ||
}) | ||
} |
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.
This is one test that's not relevant to no encap routing. We don't configure any device.
if BPFMode() { | ||
if ipipMode == api.IPIPModeNever { | ||
// one host routes per node | ||
expectedNumRoutes = len(felixes) |
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.
The number of expected routes differs for no encap routing.
if BPFMode() { | ||
if ipipMode == api.IPIPModeNever { | ||
// one host routes per node | ||
expectedNumRoutes = (len(felixes) - 1) |
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.
Again, the number of expected routes differs for no encap.
It("should configure the ipip device correctly", func() { | ||
if ipipMode == api.IPIPModeNever { | ||
Skip("ipip device is not available in no encap routing") | ||
} |
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.
This test is no applicable to no encap since no device is managed.
} | ||
} | ||
}) | ||
} |
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.
This test is also not applicable to no encap since we don't add any SNAT rule. The SNAT rule is added here
Lines 958 to 972 in a9752ec
rules = append(rules, generictables.Rule{ | |
Match: r.NewMatch(). | |
// Only match packets going out the tunnel. | |
OutInterface(tunnel). | |
// Match packets that don't have the correct source address. This | |
// matches local addresses (i.e. ones assigned to this host) | |
// limiting the match to the output interface (which we matched | |
// above as the tunnel). Avoiding embedding the IP address lets | |
// us use a static rule, which is easier to manage. | |
NotSrcAddrType(generictables.AddrTypeLocal, true). | |
// Only match if the IP is also some local IP on the box. This | |
// prevents us from matching packets from workloads, which are | |
// remote as far as the routing table is concerned. | |
SrcAddrType(generictables.AddrTypeLocal, false), | |
Action: r.Masq(""), |
And it's not needed for no encap.
It("should allow IPIP to external client if it is in ExternalNodesCIDRList", func() { | ||
if ipipMode == api.IPIPModeNever { | ||
Skip("external nodes is not applicable to no encap routing") | ||
} |
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.
This test is about accepting tunnel traffic from external nodes:
ExternalNodesCIDRList *[]string `json:"externalNodesList,omitempty"` |
We insert a rule to accept tunnel traffic from the allowed external nodes
here IPIP and VXLAN:
Line 249 in a9752ec
func (r *DefaultRuleRenderer) filterInputChain(ipVersion uint8) *generictables.Chain { |
but it's not relevant to no encap.
Description
Follow up on #10291
Adding a new manager to program no encapsulation routes.
Support for IPv6 is left out of this PR to make the review easier. It will be added in the next one.
Related issues/PRs
Todos
Release Note
Reminder for the reviewer
Make sure that this PR has the correct labels and milestone set.
Every PR needs one
docs-*
label.docs-pr-required
: This change requires a change to the documentation that has not been completed yet.docs-completed
: This change has all necessary documentation completed.docs-not-required
: This change has no user-facing impact and requires no docs.Every PR needs one
release-note-*
label.release-note-required
: This PR has user-facing changes. Most PRs should have this label.release-note-not-required
: This PR has no user-facing changes.Other optional labels:
cherry-pick-candidate
: This PR should be cherry-picked to an earlier release. For bug fixes only.needs-operator-pr
: This PR is related to install and requires a corresponding change to the operator.