Merge branch 'master' into eureka

This commit is contained in:
Emile Vauge 2016-11-29 19:04:43 +01:00 committed by GitHub
commit 22392daef7
4 changed files with 18 additions and 2 deletions

View file

@ -327,6 +327,7 @@ func NewTraefikDefaultPointersConfiguration() *TraefikConfiguration {
defaultMarathon.ExposedByDefault = true
defaultMarathon.Constraints = []types.Constraint{}
defaultMarathon.DialerTimeout = 60
defaultMarathon.KeepAlive = 10
// default Consul
var defaultConsul provider.Consul

View file

@ -845,6 +845,12 @@ domain = "marathon.localhost"
# Default: 60
# dialerTimeout = 5
# Set the TCP Keep Alive interval (in seconds) for the Marathon HTTP Client
#
# Optional
# Default: 10
#
# keepAlive = 10
```
Labels can be used on containers to override default behaviour:

View file

@ -35,6 +35,7 @@ type Marathon struct {
MarathonLBCompatibility bool `description:"Add compatibility with marathon-lb labels"`
TLS *ClientTLS `description:"Enable Docker TLS support"`
DialerTimeout time.Duration `description:"Set a non-default connection timeout for Marathon"`
KeepAlive time.Duration `description:"Set a non-default TCP Keep Alive time in seconds"`
Basic *MarathonBasic
marathonClient marathon.Marathon
}
@ -71,10 +72,11 @@ func (provider *Marathon) Provide(configurationChan chan<- types.ConfigMessage,
}
config.HTTPClient = &http.Client{
Transport: &http.Transport{
TLSClientConfig: TLSConfig,
DialContext: (&net.Dialer{
KeepAlive: provider.KeepAlive * time.Second,
Timeout: time.Second * provider.DialerTimeout,
}).DialContext,
TLSClientConfig: TLSConfig,
},
}
client, err := marathon.NewClient(config)

View file

@ -510,6 +510,13 @@
# dcosToken = "xxxxxx"
# Set the TCP Keep Alive interval (in seconds) for the Marathon HTTP Client
#
# Optional
# Default: 10
#
# keepAlive = 10
################################################################
# Mesos configuration backend
################################################################