Skip to content

Commit 96d569c

Browse files
committed
multicast: make igmp query interval configurable
Signed-off-by: Bin Liu <biliu@vmware.com>
1 parent 22b9307 commit 96d569c

15 files changed

Lines changed: 128 additions & 66 deletions

File tree

build/charts/antrea/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ Kubernetes: `>= 1.16.0-0`
7676
| kubeAPIServerOverride | string | `""` | Address of Kubernetes apiserver, to override any value provided in kubeconfig or InClusterConfig. |
7777
| logVerbosity | int | `0` | |
7878
| multicastInterfaces | list | `[]` | Names of the interfaces on Nodes that are used to forward multicast traffic. |
79+
| igmpQueryInterval | int | `125`| The interval for antrea-agent to send IGMP query to Pods, time unit is second.
7980
| noSNAT | bool | `false` | Whether or not to SNAT (using the Node IP) the egress traffic from a Pod to the external network. |
8081
| nodeIPAM.clusterCIDRs | list | `[]` | CIDR ranges to use when allocating Pod IP addresses. |
8182
| nodeIPAM.enable | bool | `false` | Enable Node IPAM in Antrea |

build/charts/antrea/conf/antrea-agent.conf

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,12 +217,19 @@ tlsMinVersion: {{ .Values.tlsMinVersion | quote }}
217217
# 3. The Node IP
218218
transportInterface: {{ .Values.transportInterface | quote }}
219219

220+
multicast:
221+
{{- with .Values.multicast }}
220222
# The names of the interfaces on Nodes that are used to forward multicast traffic.
221223
# Defaults to transport interface if not set.
222-
multicastInterfaces:
223-
{{- with .Values.multicastInterfaces }}
224-
{{- toYaml . | nindent 2 }}
225-
{{- end }}
224+
multicastInterfaces:
225+
{{- with .multicastInterfaces }}
226+
{{- toYaml . | nindent 2 }}
227+
{{- end }}
228+
229+
# The interval for antrea-agent to send IGMP query to Pods, time unit is second.
230+
# Defaults to 125 seconds.
231+
igmpQueryInterval: {{ .igmpQueryInterval }}
232+
{{- end}}
226233

227234
# The network CIDRs of the interface on Node which is used for tunneling or routing the traffic across
228235
# Nodes. If there are multiple interfaces configured the same network CIDR, the first one is used. The

build/charts/antrea/values.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,14 @@ transportInterface: ""
2828
# -- Network CIDRs of the interface on Node which is used for tunneling or
2929
# routing the traffic across Nodes.
3030
transportInterfaceCIDRs: []
31-
# -- Names of the interfaces on Nodes that are used to forward multicast traffic.
32-
multicastInterfaces: []
31+
32+
multicast:
33+
# -- Names of the interfaces on Nodes that are used to forward multicast traffic.
34+
multicastInterfaces: []
35+
# -- The interval for antrea-agent to send IGMP query to pods, time uint is second.
36+
# Defaults to 125 seconds.
37+
igmpQueryInterval: 125
38+
3339
# -- Default MTU to use for the host gateway interface and the network interface
3440
# of each Pod. By default, antrea-agent will discover the MTU of the Node's
3541
# primary interface and adjust it to accommodate for tunnel encapsulation

build/yamls/antrea-aks.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,14 @@ data:
266266
# 3. The Node IP
267267
transportInterface: ""
268268
269+
multicast:
269270
# The names of the interfaces on Nodes that are used to forward multicast traffic.
270271
# Defaults to transport interface if not set.
271-
multicastInterfaces:
272+
multicastInterfaces:
273+
274+
# The interval for antrea-agent to send IGMP query to Pods, time unit is second.
275+
# Defaults to 125 seconds.
276+
igmpQueryInterval: 125
272277
273278
# The network CIDRs of the interface on Node which is used for tunneling or routing the traffic across
274279
# Nodes. If there are multiple interfaces configured the same network CIDR, the first one is used. The
@@ -3486,7 +3491,7 @@ spec:
34863491
kubectl.kubernetes.io/default-container: antrea-agent
34873492
# Automatically restart Pods with a RollingUpdate if the ConfigMap changes
34883493
# See https://helm.sh/docs/howto/charts_tips_and_tricks/#automatically-roll-deployments
3489-
checksum/config: 4554a36b927c6e64fdbc53b4d4c64673d48c9c829ec444e3be6e699ade8481b6
3494+
checksum/config: 3b457b52eff11631f8afc718f43769caa51133a1c30a2bc858972e4ea79fd753
34903495
labels:
34913496
app: antrea
34923497
component: antrea-agent
@@ -3726,7 +3731,7 @@ spec:
37263731
annotations:
37273732
# Automatically restart Pod if the ConfigMap changes
37283733
# See https://helm.sh/docs/howto/charts_tips_and_tricks/#automatically-roll-deployments
3729-
checksum/config: 4554a36b927c6e64fdbc53b4d4c64673d48c9c829ec444e3be6e699ade8481b6
3734+
checksum/config: 3b457b52eff11631f8afc718f43769caa51133a1c30a2bc858972e4ea79fd753
37303735
labels:
37313736
app: antrea
37323737
component: antrea-controller

build/yamls/antrea-eks.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,14 @@ data:
266266
# 3. The Node IP
267267
transportInterface: ""
268268
269+
multicast:
269270
# The names of the interfaces on Nodes that are used to forward multicast traffic.
270271
# Defaults to transport interface if not set.
271-
multicastInterfaces:
272+
multicastInterfaces:
273+
274+
# The interval for antrea-agent to send IGMP query to Pods, time unit is second.
275+
# Defaults to 125 seconds.
276+
igmpQueryInterval: 125
272277
273278
# The network CIDRs of the interface on Node which is used for tunneling or routing the traffic across
274279
# Nodes. If there are multiple interfaces configured the same network CIDR, the first one is used. The
@@ -3486,7 +3491,7 @@ spec:
34863491
kubectl.kubernetes.io/default-container: antrea-agent
34873492
# Automatically restart Pods with a RollingUpdate if the ConfigMap changes
34883493
# See https://helm.sh/docs/howto/charts_tips_and_tricks/#automatically-roll-deployments
3489-
checksum/config: 4554a36b927c6e64fdbc53b4d4c64673d48c9c829ec444e3be6e699ade8481b6
3494+
checksum/config: 3b457b52eff11631f8afc718f43769caa51133a1c30a2bc858972e4ea79fd753
34903495
labels:
34913496
app: antrea
34923497
component: antrea-agent
@@ -3728,7 +3733,7 @@ spec:
37283733
annotations:
37293734
# Automatically restart Pod if the ConfigMap changes
37303735
# See https://helm.sh/docs/howto/charts_tips_and_tricks/#automatically-roll-deployments
3731-
checksum/config: 4554a36b927c6e64fdbc53b4d4c64673d48c9c829ec444e3be6e699ade8481b6
3736+
checksum/config: 3b457b52eff11631f8afc718f43769caa51133a1c30a2bc858972e4ea79fd753
37323737
labels:
37333738
app: antrea
37343739
component: antrea-controller

build/yamls/antrea-gke.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,14 @@ data:
266266
# 3. The Node IP
267267
transportInterface: ""
268268
269+
multicast:
269270
# The names of the interfaces on Nodes that are used to forward multicast traffic.
270271
# Defaults to transport interface if not set.
271-
multicastInterfaces:
272+
multicastInterfaces:
273+
274+
# The interval for antrea-agent to send IGMP query to Pods, time unit is second.
275+
# Defaults to 125 seconds.
276+
igmpQueryInterval: 125
272277
273278
# The network CIDRs of the interface on Node which is used for tunneling or routing the traffic across
274279
# Nodes. If there are multiple interfaces configured the same network CIDR, the first one is used. The
@@ -3486,7 +3491,7 @@ spec:
34863491
kubectl.kubernetes.io/default-container: antrea-agent
34873492
# Automatically restart Pods with a RollingUpdate if the ConfigMap changes
34883493
# See https://helm.sh/docs/howto/charts_tips_and_tricks/#automatically-roll-deployments
3489-
checksum/config: edef4c00e4f28a10dc1e077086ef68641a9a3b53d0fe7d47ff3dafc2ce5d5c9b
3494+
checksum/config: 78dbecf55ff93beb84ac29a187f617bd3853af405520b92cadd7a4d98c5b5ed3
34903495
labels:
34913496
app: antrea
34923497
component: antrea-agent
@@ -3726,7 +3731,7 @@ spec:
37263731
annotations:
37273732
# Automatically restart Pod if the ConfigMap changes
37283733
# See https://helm.sh/docs/howto/charts_tips_and_tricks/#automatically-roll-deployments
3729-
checksum/config: edef4c00e4f28a10dc1e077086ef68641a9a3b53d0fe7d47ff3dafc2ce5d5c9b
3734+
checksum/config: 78dbecf55ff93beb84ac29a187f617bd3853af405520b92cadd7a4d98c5b5ed3
37303735
labels:
37313736
app: antrea
37323737
component: antrea-controller

build/yamls/antrea-ipsec.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,14 @@ data:
279279
# 3. The Node IP
280280
transportInterface: ""
281281
282+
multicast:
282283
# The names of the interfaces on Nodes that are used to forward multicast traffic.
283284
# Defaults to transport interface if not set.
284-
multicastInterfaces:
285+
multicastInterfaces:
286+
287+
# The interval for antrea-agent to send IGMP query to Pods, time unit is second.
288+
# Defaults to 125 seconds.
289+
igmpQueryInterval: 125
285290
286291
# The network CIDRs of the interface on Node which is used for tunneling or routing the traffic across
287292
# Nodes. If there are multiple interfaces configured the same network CIDR, the first one is used. The
@@ -3499,7 +3504,7 @@ spec:
34993504
kubectl.kubernetes.io/default-container: antrea-agent
35003505
# Automatically restart Pods with a RollingUpdate if the ConfigMap changes
35013506
# See https://helm.sh/docs/howto/charts_tips_and_tricks/#automatically-roll-deployments
3502-
checksum/config: 50cc962db93c0354f5eaa088e51d690e779692979cbafac0c3e27a88fc2c0c7c
3507+
checksum/config: 0d141884a1852335a8a14916850b5b9d8924f0b205a6b9bf179399381bf04fea
35033508
checksum/ipsec-secret: d0eb9c52d0cd4311b6d252a951126bf9bea27ec05590bed8a394f0f792dcb2a4
35043509
labels:
35053510
app: antrea
@@ -3775,7 +3780,7 @@ spec:
37753780
annotations:
37763781
# Automatically restart Pod if the ConfigMap changes
37773782
# See https://helm.sh/docs/howto/charts_tips_and_tricks/#automatically-roll-deployments
3778-
checksum/config: 50cc962db93c0354f5eaa088e51d690e779692979cbafac0c3e27a88fc2c0c7c
3783+
checksum/config: 0d141884a1852335a8a14916850b5b9d8924f0b205a6b9bf179399381bf04fea
37793784
labels:
37803785
app: antrea
37813786
component: antrea-controller

build/yamls/antrea.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,14 @@ data:
266266
# 3. The Node IP
267267
transportInterface: ""
268268
269+
multicast:
269270
# The names of the interfaces on Nodes that are used to forward multicast traffic.
270271
# Defaults to transport interface if not set.
271-
multicastInterfaces:
272+
multicastInterfaces:
273+
274+
# The interval for antrea-agent to send IGMP query to Pods, time unit is second.
275+
# Defaults to 125 seconds.
276+
igmpQueryInterval: 125
272277
273278
# The network CIDRs of the interface on Node which is used for tunneling or routing the traffic across
274279
# Nodes. If there are multiple interfaces configured the same network CIDR, the first one is used. The
@@ -3486,7 +3491,7 @@ spec:
34863491
kubectl.kubernetes.io/default-container: antrea-agent
34873492
# Automatically restart Pods with a RollingUpdate if the ConfigMap changes
34883493
# See https://helm.sh/docs/howto/charts_tips_and_tricks/#automatically-roll-deployments
3489-
checksum/config: f7414e9171ab246b09dc380bc7934ebac81af7a5ef7bd3f73d661b6301040768
3494+
checksum/config: 37d55103cfa223781c44d6d05c7094cc8038fc6c4c03770bca35065acd4ba81a
34903495
labels:
34913496
app: antrea
34923497
component: antrea-agent
@@ -3726,7 +3731,7 @@ spec:
37263731
annotations:
37273732
# Automatically restart Pod if the ConfigMap changes
37283733
# See https://helm.sh/docs/howto/charts_tips_and_tricks/#automatically-roll-deployments
3729-
checksum/config: f7414e9171ab246b09dc380bc7934ebac81af7a5ef7bd3f73d661b6301040768
3734+
checksum/config: 37d55103cfa223781c44d6d05c7094cc8038fc6c4c03770bca35065acd4ba81a
37303735
labels:
37313736
app: antrea
37323737
component: antrea-controller

cmd/antrea-agent/agent.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,9 +589,10 @@ func run(o *Options) error {
589589
nodeConfig,
590590
ifaceStore,
591591
multicastSocket,
592-
sets.NewString(append(o.config.MulticastInterfaces, nodeConfig.NodeTransportInterfaceName)...),
592+
sets.NewString(append(o.config.Multicast.MulticastInterfaces, nodeConfig.NodeTransportInterfaceName)...),
593593
ovsBridgeClient,
594-
podUpdateChannel)
594+
podUpdateChannel,
595+
o.igmpQueryInterval)
595596
if err := mcastController.Initialize(); err != nil {
596597
return err
597598
}

cmd/antrea-agent/options.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ const (
4747
defaultFlowPollInterval = 5 * time.Second
4848
defaultActiveFlowExportTimeout = 30 * time.Second
4949
defaultIdleFlowExportTimeout = 15 * time.Second
50+
defaultIGMPQueryInterval = 125 * time.Second
5051
defaultStaleConnectionTimeout = 5 * time.Minute
5152
defaultNPLPortRange = "61000-62000"
5253
)
@@ -68,8 +69,10 @@ type Options struct {
6869
idleFlowTimeout time.Duration
6970
// Stale connection timeout to delete connections if they are not exported.
7071
staleConnectionTimeout time.Duration
71-
nplStartPort int
72-
nplEndPort int
72+
// IGMP query interval
73+
igmpQueryInterval time.Duration
74+
nplStartPort int
75+
nplEndPort int
7376
}
7477

7578
func newOptions() *Options {
@@ -271,6 +274,14 @@ func (o *Options) setDefaults() {
271274
o.config.NodePortLocal.PortRange = defaultNPLPortRange
272275
}
273276
}
277+
278+
if features.DefaultFeatureGate.Enabled(features.Multicast) {
279+
if o.config.Multicast.IGMPQueryInterval == 0 {
280+
o.igmpQueryInterval = defaultIGMPQueryInterval
281+
} else {
282+
o.igmpQueryInterval = time.Duration(o.config.Multicast.IGMPQueryInterval) * time.Second
283+
}
284+
}
274285
}
275286

276287
func (o *Options) validateAntreaProxyConfig() error {

0 commit comments

Comments
 (0)