-
Notifications
You must be signed in to change notification settings - Fork 165
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
Handle edge-node clustering in mangle table marking with flowlog enabled #4546
Handle edge-node clustering in mangle table marking with flowlog enabled #4546
Conversation
naiming-zededa
commented
Jan 24, 2025
- similar to the filter table PR PR4408 and networking changes for Clustering #4454, this one to allow edge-node clustring ip packets to communicate when the device has flowlog enabled.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4546 +/- ##
=======================================
Coverage 20.90% 20.90%
=======================================
Files 13 13
Lines 2894 2894
=======================================
Hits 605 605
Misses 2163 2163
Partials 126 126 ☔ View full report in Codecov by Sentry. |
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.
Run tests
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, from code perspective since we are using new rules only for Kubernetes, I'd do something like this:
func defaultKubernetesIptablesRules() []iptables.Rule {
// Allow all traffic from Kubernetes pods to Kubernetes services.
// Note that traffic originating from another node is already D-NATed
// and will get marked with the kube_pod mark.
markKubeSvc := iptables.Rule{
RuleLabel: "Kubernetes service mark",
MatchOpts: []string{"-s", kubePodCIDR.String(), "-d", kubeSvcCIDR.String()},
Target: "CONNMARK",
TargetOpts: []string{"--set-mark", controlProtoMark("kube_svc")},
Description: "Mark traffic from Kubernetes pods to Kubernetes services",
}
// ...
return []iptables.Rule{
markKubeSvc,
// ...
}
}
func (r *LinuxDpcReconciler) getIntendedMarkingRules(dpc types.DevicePortConfig, intendedIPv4ACLs, intendedIPv6ACLs dg.Graph) {
// ...
if r.HVTypeKube {
protoMarkV4Rules = append(protoMarkV4Rules, defaultKubernetesIptablesRules()...)
}
}
And we won't run Kubernetes over ipv6, right?
- similar to the filter table PR lf-edge#4454, this one to allow edge-node clustring ip packets to communicate when the device has flowlog enabled. Signed-off-by: Naiming Shen <naiming@zededa.com>
fcdb6a2
to
3c1d69b
Compare
Good suggestion, updated. Correct, at the moment of this code, we don't support ipv6 applications for kubernetes. |
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
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.
Re-run tests