diff --git a/provider/marathon.go b/provider/marathon.go index 7094b1f9a..a2c8f5532 100644 --- a/provider/marathon.go +++ b/provider/marathon.go @@ -18,9 +18,16 @@ type Marathon struct { Endpoint string Domain string NetworkInterface string + Basic *MarathonBasic marathonClient lightMarathonClient } +// MarathonBasic holds basic authentication specific configurations +type MarathonBasic struct { + HTTPBasicAuthUser string + HTTPBasicPassword string +} + type lightMarathonClient interface { Applications(url.Values) (*marathon.Applications, error) AllTasks(v url.Values) (*marathon.Tasks, error) @@ -32,6 +39,10 @@ func (provider *Marathon) Provide(configurationChan chan<- types.ConfigMessage) config := marathon.NewDefaultConfig() config.URL = provider.Endpoint config.EventsInterface = provider.NetworkInterface + if provider.Basic != nil { + config.HTTPBasicAuthUser = provider.Basic.HTTPBasicAuthUser + config.HTTPBasicPassword = provider.Basic.HTTPBasicPassword + } client, err := marathon.NewClient(config) if err != nil { log.Errorf("Failed to create a client for marathon, error: %s", err) diff --git a/tests/compose-marathon.yml b/tests/compose-marathon.yml index 91685e963..d749fe095 100644 --- a/tests/compose-marathon.yml +++ b/tests/compose-marathon.yml @@ -6,7 +6,7 @@ zk: ZK_ID: 1 master: - image: mesosphere/mesos-master:0.23.0-1.0.ubuntu1404 + image: mesosphere/mesos-master:0.26.0-0.2.145.ubuntu1404 net: host environment: MESOS_ZK: zk://127.0.0.1:2181/mesos @@ -17,7 +17,7 @@ master: MESOS_WORK_DIR: /var/lib/mesos slave: - image: mesosphere/mesos-slave:0.23.0-1.0.ubuntu1404 + image: mesosphere/mesos-slave:0.26.0-0.2.145.ubuntu1404 net: host pid: host privileged: true @@ -33,7 +33,7 @@ slave: - /var/run/docker.sock:/var/run/docker.sock marathon: - image: mesosphere/marathon:v0.9.2 + image: mesosphere/marathon:v0.13.0 net: host environment: MARATHON_MASTER: zk://127.0.0.1:2181/mesos diff --git a/tests/whoami.json b/tests/whoami.json index 741d399d8..138a2264d 100644 --- a/tests/whoami.json +++ b/tests/whoami.json @@ -10,14 +10,7 @@ "network": "BRIDGE", "portMappings": [ { "containerPort": 80, "hostPort": 0, "protocol": "tcp" } - ], - "parameters": [{ - "key": "log-driver", - "value": "gelf" - }, { - "key": "log-opt", - "value": "gelf-address=udp://172.17.42.1:12201" - }] + ] } }, "healthChecks": [ @@ -32,8 +25,6 @@ ], "labels": { "traefik.weight": "1", - "traefik.protocole": "https", - "traefik.frontend.rule": "Path", - "traefik.frontend.value": "/test" + "traefik.protocole": "http" } } diff --git a/traefik.sample.toml b/traefik.sample.toml index f6cf80c77..020bc4acf 100644 --- a/traefik.sample.toml +++ b/traefik.sample.toml @@ -142,6 +142,8 @@ # Enable docker TLS connection # +# Optional +# # [docker.tls] # ca = "/etc/ssl/ca.crt" # cert = "/etc/ssl/docker.crt" @@ -192,6 +194,14 @@ # # filename = "marathon.tmpl" +# Enable Marathon basic authentication +# +# Optional +# +# [marathon.basic] +# httpBasicAuthUser = "foo" +# httpBasicPassword = "bar" + ################################################################ # Consul KV configuration backend