Skip to content
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: make igmp query interval configurable #3819

Merged
merged 1 commit into from
May 26, 2022

Conversation

liu4480
Copy link
Contributor

@liu4480 liu4480 commented May 23, 2022

For multicast, IGMP query is sent by antrea-agent every 125 seconds. This patch makes IGMP query interval configurable.

@codecov-commenter
Copy link

codecov-commenter commented May 23, 2022

Codecov Report

Merging #3819 (4f73825) into main (1886ecb) will decrease coverage by 7.98%.
The diff coverage is 91.30%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3819      +/-   ##
==========================================
- Coverage   64.38%   56.39%   -7.99%     
==========================================
  Files         284      398     +114     
  Lines       40248    55938   +15690     
==========================================
+ Hits        25912    31547    +5635     
- Misses      12304    21923    +9619     
- Partials     2032     2468     +436     
Flag Coverage Δ
integration-tests 38.20% <ø> (?)
kind-e2e-tests 51.29% <0.00%> (-1.50%) ⬇️
unit-tests 43.92% <91.30%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/agent/multicast/mcast_controller.go 61.63% <89.47%> (+0.25%) ⬆️
pkg/agent/multicast/mcast_discovery.go 61.90% <100.00%> (ø)
pkg/controller/egress/store/egressgroup.go 1.72% <0.00%> (-54.32%) ⬇️
.../agent/flowexporter/connections/conntrack_linux.go 58.06% <0.00%> (-27.42%) ⬇️
pkg/agent/util/net.go 29.33% <0.00%> (-22.23%) ⬇️
pkg/agent/route/route_linux.go 30.17% <0.00%> (-19.63%) ⬇️
pkg/agent/util/ipset/ipset.go 59.45% <0.00%> (-8.11%) ⬇️
pkg/agent/openflow/service.go 78.16% <0.00%> (-5.75%) ⬇️
pkg/util/k8s/client.go 35.71% <0.00%> (-5.36%) ⬇️
pkg/controller/networkpolicy/tier.go 50.00% <0.00%> (-5.00%) ⬇️
... and 127 more

@liu4480 liu4480 force-pushed the configure-IGMP-query-interval branch from fe885c8 to 489cae5 Compare May 23, 2022 08:24
@liu4480 liu4480 requested a review from wenyingd May 23, 2022 08:29
@liu4480
Copy link
Contributor Author

liu4480 commented May 23, 2022

verified in testbed

@liu4480 liu4480 force-pushed the configure-IGMP-query-interval branch from 489cae5 to 7884919 Compare May 23, 2022 09:18
Copy link
Member

@tnqn tnqn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't make sense to add a user-facing configuration parameter just to make test quicker.
But I think igmp query interval itself is good to be configurable since this is configurable in physical routers. I would not say this is for testing only in PR description.
And the title can be simplified: "multicast: make igmp query interval configurable"

build/charts/antrea/README.md Outdated Show resolved Hide resolved
pkg/agent/multicast/mcast_discovery.go Show resolved Hide resolved
pkg/agent/multicast/mcast_discovery.go Outdated Show resolved Hide resolved
@liu4480 liu4480 changed the title multicast: set igmp query interval by adding igmpQueryInterval in agent.conf multicast: make igmp query interval configurable May 23, 2022
@liu4480 liu4480 force-pushed the configure-IGMP-query-interval branch from 7884919 to ba33470 Compare May 23, 2022 10:41
@liu4480 liu4480 force-pushed the configure-IGMP-query-interval branch from ba33470 to 0fc2e49 Compare May 23, 2022 11:52
@@ -185,6 +185,9 @@ type AgentConfig struct {
// The names of the interfaces on Nodes that are used to forward multicast traffic.
// Defaults to transport interface if not set.
MulticastInterfaces []string `yaml:"multicastInterfaces,omitempty"`
// The interval for antrea-agent to send IGMP query to pods, time uint is second.
// Defaults to 125 seconds.
IGMPQueryInterval int `yaml:"igmpQueryInterval"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wenyingd @liu4480 do we likely have other similar configurations in the future? I wonder if we should group them in one struct, including multicastInterfaces.
cc @antoninbas

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't say no other configurations are needed in future. Agree to use one struct to group them if possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I will add a group for multicast

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

grouping them sounds good to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@liu4480 liu4480 force-pushed the configure-IGMP-query-interval branch from 0fc2e49 to 96d569c Compare May 24, 2022 09:32
@liu4480 liu4480 added this to the Antrea v1.7 release milestone May 24, 2022
@liu4480 liu4480 force-pushed the configure-IGMP-query-interval branch 2 times, most recently from 99514c2 to ec768e5 Compare May 24, 2022 10:44
wenyingd
wenyingd previously approved these changes May 24, 2022
Copy link
Contributor

@wenyingd wenyingd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

pkg/config/agent/config.go Show resolved Hide resolved
@@ -47,6 +47,7 @@ Generate a YAML manifest for Antrea using Helm and print it to stdout.
--help, -h Print this message and exit
--multicast Generates a manifest for multicast.
--multicast-interfaces Multicast interface names (default is empty)
--igmpquery-interval Interval to send IGMP query, time unit is second (default is 125)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems too specific. I think you can use --extra-helm-values-file or add a --extra-helm-values argument.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed this option, and use --extra-helm-values-file

@@ -75,7 +75,8 @@ Kubernetes: `>= 1.16.0-0`
| ipsec.psk | string | `"changeme"` | Preshared Key (PSK) for IKE authentication. It will be stored in a secret and passed to antrea-agent as an environment variable. |
| kubeAPIServerOverride | string | `""` | Address of Kubernetes apiserver, to override any value provided in kubeconfig or InClusterConfig. |
| logVerbosity | int | `0` | |
| multicastInterfaces | list | `[]` | Names of the interfaces on Nodes that are used to forward multicast traffic. |
| multicast.igmpQueryInterval | int | `125` | The interval for antrea-agent to send IGMP query to pods, time uint is second. Defaults to 125 seconds. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pods -> Pods

query -> queries

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

{{- toYaml . | nindent 4 }}
{{- end }}

# The interval for antrea-agent to send IGMP query to Pods, time unit is second.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

queries

pkg/config/agent/config.go Show resolved Hide resolved
// The names of the interfaces on Nodes that are used to forward multicast traffic.
// Defaults to transport interface if not set.
MulticastInterfaces []string `yaml:"multicastInterfaces,omitempty"`
// The interval for antrea-agent to send IGMP query to pods, time uint is second.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

queries

Pods

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

multicast:
# -- Names of the interfaces on Nodes that are used to forward multicast traffic.
multicastInterfaces: []
# -- The interval for antrea-agent to send IGMP query to pods, time uint is second.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# -- The interval for antrea-agent to send IGMP query to pods, time uint is second.
# -- The interval in seconds at which the antrea-agent send IGMP queries to Pods.

# -- Names of the interfaces on Nodes that are used to forward multicast traffic.
multicastInterfaces: []
# -- The interval for antrea-agent to send IGMP query to pods, time uint is second.
# Defaults to 125 seconds.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can remove this IMO, the default is already used to configure the value below

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

multicastInterfaces: []
# -- The interval for antrea-agent to send IGMP query to pods, time uint is second.
# Defaults to 125 seconds.
igmpQueryInterval: 125
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tnqn do you think that for time durations we should consistently use go duration strings (e.g. "125s", "2m", "1m30s", ...)?
I think that K8s components do that and we also do that for other Antrea configuration parameters (for the Flow Aggregator IIRC).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@liu4480 liu4480 force-pushed the configure-IGMP-query-interval branch from 1bff55b to 1ad8513 Compare May 25, 2022 01:00
@liu4480 liu4480 requested a review from antoninbas May 25, 2022 01:00
jianjuns
jianjuns previously approved these changes May 25, 2022
func (o *Options) validateMulticastConfig() error {
if features.DefaultFeatureGate.Enabled(features.Multicast) {
var err error
o.igmpQueryInterval, err = time.ParseDuration(o.config.Multicast.IGMPQueryInterval)
Copy link
Member

@tnqn tnqn May 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should only parse it when it's not empty? otherwise empty value would crash the process?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, done

@liu4480 liu4480 force-pushed the configure-IGMP-query-interval branch from 949a135 to b58f396 Compare May 25, 2022 14:14
Copy link
Contributor

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small comment, otherwise LGTM

{{- toYaml . | nindent 4 }}
{{- end }}

# The interval at which the antrea-agent to send IGMP queries to Pods.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/to send/sends

in all the other places as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -68,8 +69,10 @@ type Options struct {
idleFlowTimeout time.Duration
// Stale connection timeout to delete connections if they are not exported.
staleConnectionTimeout time.Duration
nplStartPort int
nplEndPort int
// IGMP query interval
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a useful comment IMO, it just repeats the variable name; you could remove that line altogether

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

Signed-off-by: Bin Liu <biliu@vmware.com>
@liu4480 liu4480 force-pushed the configure-IGMP-query-interval branch from b58f396 to 4f73825 Compare May 25, 2022 23:02
@jianjuns
Copy link
Contributor

/test-all

Copy link
Member

@tnqn tnqn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tnqn
Copy link
Member

tnqn commented May 26, 2022

/skip-conformance no change related to conformance test

@tnqn tnqn merged commit 6d3036b into antrea-io:main May 26, 2022
@liu4480 liu4480 deleted the configure-IGMP-query-interval branch May 26, 2022 11:19
vrabbi pushed a commit to vrabbi/antrea that referenced this pull request May 26, 2022
Signed-off-by: Bin Liu <biliu@vmware.com>
Signed-off-by: Scott Rosenberg <scott@terasky.com>
XinShuYang added a commit to XinShuYang/antrea that referenced this pull request Jun 9, 2022
)"

This reverts commit 6d3036b.

Signed-off-by: Shuyang Xin <gavinx@vmware.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants