-
Notifications
You must be signed in to change notification settings - Fork 386
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
Conversation
Codecov Report
@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more.
|
fe885c8
to
489cae5
Compare
verified in testbed |
489cae5
to
7884919
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.
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"
igmpQueryInterval
in agent.conf7884919
to
ba33470
Compare
ba33470
to
0fc2e49
Compare
pkg/config/agent/config.go
Outdated
@@ -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"` |
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.
@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
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.
I can't say no other configurations are needed in future. Agree to use one struct to group them if possible.
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.
OK, I will add a group for multicast
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.
grouping them sounds good to me.
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.
done
0fc2e49
to
96d569c
Compare
99514c2
to
ec768e5
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
hack/generate-manifest.sh
Outdated
@@ -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) |
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 seems too specific. I think you can use --extra-helm-values-file
or add a --extra-helm-values
argument.
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.
removed this option, and use --extra-helm-values-file
ec768e5
to
1bff55b
Compare
build/charts/antrea/README.md
Outdated
@@ -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. | |
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.
pods -> Pods
query -> queries
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.
done
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
|
||
# The interval for antrea-agent to send IGMP query to Pods, time unit is second. |
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.
queries
pkg/config/agent/config.go
Outdated
// 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. |
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.
queries
Pods
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.
done
build/charts/antrea/values.yaml
Outdated
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. |
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 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. |
build/charts/antrea/values.yaml
Outdated
# -- 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. |
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.
you can remove this IMO, the default is already used to configure the value below
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.
done
build/charts/antrea/values.yaml
Outdated
multicastInterfaces: [] | ||
# -- The interval for antrea-agent to send IGMP query to pods, time uint is second. | ||
# Defaults to 125 seconds. | ||
igmpQueryInterval: 125 |
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.
@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).
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.
done
1bff55b
to
1ad8513
Compare
1ad8513
to
949a135
Compare
cmd/antrea-agent/options.go
Outdated
func (o *Options) validateMulticastConfig() error { | ||
if features.DefaultFeatureGate.Enabled(features.Multicast) { | ||
var err error | ||
o.igmpQueryInterval, err = time.ParseDuration(o.config.Multicast.IGMPQueryInterval) |
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.
I think it should only parse it when it's not empty? otherwise empty value would crash the process?
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.
thanks, done
949a135
to
b58f396
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.
small comment, otherwise LGTM
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
|
||
# The interval at which the antrea-agent to send IGMP queries to Pods. |
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.
s/to send/sends
in all the other places as well
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.
done
cmd/antrea-agent/options.go
Outdated
@@ -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 |
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.
not a useful comment IMO, it just repeats the variable name; you could remove that line altogether
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.
removed
Signed-off-by: Bin Liu <biliu@vmware.com>
b58f396
to
4f73825
Compare
/test-all |
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
/skip-conformance no change related to conformance test |
Signed-off-by: Bin Liu <biliu@vmware.com> Signed-off-by: Scott Rosenberg <scott@terasky.com>
)" This reverts commit 6d3036b. Signed-off-by: Shuyang Xin <gavinx@vmware.com>
For multicast, IGMP query is sent by antrea-agent every 125 seconds. This patch makes IGMP query interval configurable.