Skip to content

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

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

mazdakn
Copy link
Member

@mazdakn mazdakn commented May 26, 2025

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

  • Tests
  • Documentation
  • Release note

Release Note

Enhance Felix to program routes for no encapsulation IP pools instead of BIRD.

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.

@mazdakn mazdakn requested a review from a team as a code owner May 26, 2025 22:28
@marvin-tigera marvin-tigera added this to the Calico v3.31.0 milestone May 26, 2025
@marvin-tigera marvin-tigera added release-note-required Change has user-facing impact (no matter how small) docs-pr-required Change is not yet documented labels May 26, 2025

// No encap routing tests. BrokenXSum is irrelevant in these cases.
{api.IPIPModeNever, "CalicoIPAM", false},
{api.IPIPModeNever, "WorkloadIPs", false},
Copy link
Member Author

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"))
})
}
Copy link
Member Author

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)
Copy link
Member Author

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)
Copy link
Member Author

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")
}
Copy link
Member Author

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.

}
}
})
}
Copy link
Member Author

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

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")
}
Copy link
Member Author

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:

func (r *DefaultRuleRenderer) filterInputChain(ipVersion uint8) *generictables.Chain {

but it's not relevant to no encap.

@mazdakn mazdakn changed the title Felix programs no encapsulation routes Felix programs in-cluster no encapsulation routes May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-pr-required Change is not yet documented release-note-required Change has user-facing impact (no matter how small)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants