Bläddra i källkod

Allow to set the control plane MTU

Add daemon config to allow the user to specify the MTU of the control plane network.
The first user of this new parameter is actually libnetwork that can seed the
gossip with the proper MTU value allowing to pack multiple messages per UDP packet sent.
If the value is not specified or is lower than 1500 the logic will set it to the default.

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
Flavio Crisciani 8 år sedan
förälder
incheckning
f9f25ca5e4
3 ändrade filer med 5 tillägg och 0 borttagningar
  1. 1 0
      cmd/dockerd/config.go
  2. 2 0
      daemon/config/config.go
  3. 2 0
      daemon/daemon.go

+ 1 - 0
cmd/dockerd/config.go

@@ -63,6 +63,7 @@ func installCommonConfigFlags(conf *config.Config, flags *pflag.FlagSet) {
 	flags.StringVar(&conf.MetricsAddress, "metrics-addr", "", "Set default address and port to serve the metrics api on")
 
 	flags.StringVar(&conf.NodeGenericResources, "node-generic-resources", "", "user defined resources (e.g. fpga=2;gpu={UUID1,UUID2,UUID3})")
+	flags.IntVar(&conf.NetworkControlPlaneMTU, "network-control-plane-mtu", config.DefaultNetworkMtu, "Network Control plane MTU")
 
 	// "--deprecated-key-path" is to allow configuration of the key used
 	// for the daemon ID and the deprecated image signing. It was never

+ 2 - 0
daemon/config/config.go

@@ -171,6 +171,8 @@ type CommonConfig struct {
 
 	// Exposed node Generic Resources
 	NodeGenericResources string `json:"node-generic-resources,omitempty"`
+	// NetworkControlPlaneMTU allows to specify the control plane MTU, this will allow to optimize the network use in some components
+	NetworkControlPlaneMTU int `json:"network-control-plane-mtu,omitempty"`
 }
 
 // IsValueSet returns true if a configuration value

+ 2 - 0
daemon/daemon.go

@@ -1149,6 +1149,8 @@ func (daemon *Daemon) networkOptions(dconfig *config.Config, pg plugingetter.Plu
 		options = append(options, nwconfig.OptionPluginGetter(pg))
 	}
 
+	options = append(options, nwconfig.OptionNetworkControlPlaneMTU(dconfig.NetworkControlPlaneMTU))
+
 	return options, nil
 }