-
Notifications
You must be signed in to change notification settings - Fork 367
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
Multicast statistics implementation #3449
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3449 +/- ##
==========================================
- Coverage 64.48% 64.46% -0.03%
==========================================
Files 291 293 +2
Lines 42795 43224 +429
==========================================
+ Hits 27598 27864 +266
- Misses 12974 13130 +156
- Partials 2223 2230 +7
Flags with carried forward coverage won't be shown. Click here to find out more.
|
/test-multicast-e2e |
3 similar comments
/test-multicast-e2e |
/test-multicast-e2e |
/test-multicast-e2e |
d8ad94d
to
3825049
Compare
3825049
to
3714028
Compare
/test-multicast-e2e |
9dcd1a2
to
0b6f728
Compare
/test-multicast-e2e |
1 similar comment
/test-multicast-e2e |
1ecf91c
to
7d3bb79
Compare
1fb0f2b
to
d2153dd
Compare
pkg/agent/openflow/multicast.go
Outdated
@@ -99,6 +100,46 @@ func (f *featureMulticast) multicastOutputFlow(cookieID uint64) binding.Flow { | |||
Done() | |||
} | |||
|
|||
func (f *featureMulticast) multicastSkipIGMPMetricFlows() []binding.Flow { | |||
return []binding.Flow{ |
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.
Use this format?
cookieID := f.cookieAllocator.Request(f.category).Raw()
var flows []binding.Flow
for _, t := range []*Table{MulticastIngressPodMetricTable, MulticastEgressPodMetricTable} {
flows = append(flows, t.ofTable.BuildFlow(priorityHigh).
Cookie(cookieID).
MatchProtocol(binding.ProtocolIGMP).
Action().NextTable().
Done())
}
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.
updated
pkg/agent/openflow/multicast.go
Outdated
Cookie(f.cookieAllocator.Request(f.category).Raw()). | ||
MatchProtocol(ipProtocol). | ||
MatchSrcIP(podIP). | ||
MatchDstIPNet(*types.McastCIDR). |
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.
Yes, it looks not necessary.
d2153dd
to
a7020f2
Compare
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
pkg/antctl/antctl.go
Outdated
params: []flagInfo{ | ||
{ | ||
name: "name", | ||
usage: "Retrieve Pod interface by name. If present, Namespace must be provided.", |
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.
wrong usage
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.
updated
pkg/antctl/antctl.go
Outdated
}, | ||
{ | ||
name: "namespace", | ||
usage: "Get Pod interfaces from specific Namespace", |
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.
ditto
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.
updated
for i, pod := range stats.Pods { | ||
podNameSlice[i] = k8s.NamespacedName(pod.Namespace, pod.Name) | ||
} | ||
return []interface{}{stats.Group, strings.Join(podNameSlice, ", ")}, nil |
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.
then we should cut it and append a number and ... like other commands since there will be likely some Pods in a Group?
pkg/controller/stats/aggregator.go
Outdated
for _, mcastGroupInfo := range summary.Multicast { | ||
group := mcastGroupInfo.Group | ||
reportedGroups.Insert(group) | ||
a.groupNodePodsMapMutex.Lock() |
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.
acquring lock is not free, seems not worth to lock and unlock repeatedly here to exclude a few code from critical area, which may take more cost
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.
updated
98f7ba1
to
178794b
Compare
36cd78e
to
1169210
Compare
This PR added multicast statistics support for the following cases: - Supplements current networkpolicy statistics implementation by parsing multicast related flows, which can be displayed as kubectl get antreanetworkpolicystats multicast-networkpolicy-name. - Add a node-level antctl command antctl get podmulticaststats, showing inbound and outbound packet count for each pod interface. - Add an extra kubectl get multicastgroups command. This command shows which pods have joined multicast group for the whole cluster. Signed-off-by: ceclinux <src655@gmail.com>
1169210
to
8284475
Compare
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
/test-all |
/test-multicast-e2e |
/test-multicast-e2e |
1 similar comment
/test-multicast-e2e |
This PR added multicast statistics support for the following cases: