Merge pull request #687 from containous/some-fixes

Some fixes
This commit is contained in:
Emile Vauge 2016-09-27 22:21:59 +02:00 committed by GitHub
commit 454b191370
17 changed files with 308 additions and 184 deletions

View file

@ -61,8 +61,9 @@ Run it and forget it!
- Retry request if network error - Retry request if network error
- [Let's Encrypt](https://letsencrypt.org) support (Automatic HTTPS with renewal) - [Let's Encrypt](https://letsencrypt.org) support (Automatic HTTPS with renewal)
## Demo ## Quickstart
You can have a quick look at Træfɪk in this [Katacoda tutorial](https://www.katacoda.com/courses/traefik/deploy-load-balancer) that shows how to load balance requests between multiple Docker containers.
Here is a talk (in French) given by [Emile Vauge](https://github.com/emilevauge) at the [Devoxx France 2016](http://www.devoxx.fr) conference. Here is a talk (in French) given by [Emile Vauge](https://github.com/emilevauge) at the [Devoxx France 2016](http://www.devoxx.fr) conference.
You will learn fundamental Træfɪk features and see some demos with Docker, Mesos/Marathon and Let's Encrypt. You will learn fundamental Træfɪk features and see some demos with Docker, Mesos/Marathon and Let's Encrypt.

View file

@ -36,7 +36,9 @@ Routes to your services will be created instantly.
Run it and forget it! Run it and forget it!
## Demo ## Quickstart
You can have a quick look at Træfɪk in this [Katacoda tutorial](https://www.katacoda.com/courses/traefik/deploy-load-balancer) that shows how to load balance requests between multiple Docker containers.
Here is a talk (in french) given by [Emile Vauge](https://github.com/emilevauge) at the [Devoxx France 2016](http://www.devoxx.fr) conference. Here is a talk (in french) given by [Emile Vauge](https://github.com/emilevauge) at the [Devoxx France 2016](http://www.devoxx.fr) conference.
You will learn fundamental Træfɪk features and see some demos with Docker, Mesos/Marathon and Lets'Encrypt. You will learn fundamental Træfɪk features and see some demos with Docker, Mesos/Marathon and Lets'Encrypt.

View file

@ -85,25 +85,23 @@ Supported filters:
``` ```
# Constraints definition # Constraints definition
# #
# Optional # Optional
# #
# Simple matching constraint # Simple matching constraint
# constraints = ["tag==api"] # constraints = ["tag==api"]
#
# Simple mismatching constraint # Simple mismatching constraint
# constraints = ["tag!=api"] # constraints = ["tag!=api"]
#
# Globbing # Globbing
# constraints = ["tag==us-*"] # constraints = ["tag==us-*"]
#
# Backend-specific constraint # Backend-specific constraint
# [consulCatalog] # [consulCatalog]
# endpoint = 127.0.0.1:8500 # endpoint = 127.0.0.1:8500
# constraints = ["tag==api"] # constraints = ["tag==api"]
#
# Multiple constraints # Multiple constraints
# - "tag==" must match with at least one tag # - "tag==" must match with at least one tag
# - "tag!=" must match with none of tags # - "tag!=" must match with none of tags
@ -891,13 +889,6 @@ prefix = "traefik"
# cert = "/etc/ssl/consul.crt" # cert = "/etc/ssl/consul.crt"
# key = "/etc/ssl/consul.key" # key = "/etc/ssl/consul.key"
# insecureskipverify = true # insecureskipverify = true
# Constraint on ConsulKV tags
#
# Optional
#
# constraints = ["tag==api", "tag==he*ld"]
# Matching with containers having a key "/traefik/backends/backend1/servers/server1/tags" equal to "api,helloworld"
``` ```
Please refer to the [Key Value storage structure](/user-guide/kv-config/#key-value-storage-structure) section to get documentation on traefik KV structure. Please refer to the [Key Value storage structure](/user-guide/kv-config/#key-value-storage-structure) section to get documentation on traefik KV structure.
@ -1001,13 +992,6 @@ prefix = "/traefik"
# cert = "/etc/ssl/etcd.crt" # cert = "/etc/ssl/etcd.crt"
# key = "/etc/ssl/etcd.key" # key = "/etc/ssl/etcd.key"
# insecureskipverify = true # insecureskipverify = true
# Constraint on Etcd tags
#
# Optional
#
# constraints = ["tag==api", "tag==he*ld"]
# Matching with containers having a key "/traefik/backends/backend1/servers/server1/tags" equal to "api,helloworld"
``` ```
Please refer to the [Key Value storage structure](/user-guide/kv-config/#key-value-storage-structure) section to get documentation on traefik KV structure. Please refer to the [Key Value storage structure](/user-guide/kv-config/#key-value-storage-structure) section to get documentation on traefik KV structure.
@ -1051,13 +1035,6 @@ prefix = "/traefik"
# Optional # Optional
# #
# filename = "zookeeper.tmpl" # filename = "zookeeper.tmpl"
# Constraint on Zookeeper tags
#
# Optional
#
# constraints = ["tag==api", "tag==he*ld"]
# Matching with containers having a key "/traefik/backends/backend1/servers/server1/tags" equal to "api,helloworld"
``` ```
Please refer to the [Key Value storage structure](/user-guide/kv-config/#key-value-storage-structure) section to get documentation on traefik KV structure. Please refer to the [Key Value storage structure](/user-guide/kv-config/#key-value-storage-structure) section to get documentation on traefik KV structure.
@ -1100,13 +1077,6 @@ prefix = "/traefik"
# Optional # Optional
# #
# filename = "boltdb.tmpl" # filename = "boltdb.tmpl"
# Constraint on BoltDB tags
#
# Optional
#
# constraints = ["tag==api", "tag==he*ld"]
# Matching with containers having a key "/traefik/backends/backend1/servers/server1/tags" equal to "api,helloworld"
``` ```
Please refer to the [Key Value storage structure](/user-guide/kv-config/#key-value-storage-structure) section to get documentation on traefik KV structure. Please refer to the [Key Value storage structure](/user-guide/kv-config/#key-value-storage-structure) section to get documentation on traefik KV structure.

220
glide.lock generated
View file

@ -1,22 +1,24 @@
hash: 809b3fa812ca88940fdc15530804a4bcd881708e4819fed5aa45c42c871ba5cf hash: b82175c1aafff6c4e98c8ac4baea3832895c9600beac445c10af4c004982ef05
updated: 2016-09-20T14:50:04.029710103+02:00 updated: 2016-09-20T16:03:26.379383173+02:00
imports: imports:
- name: github.com/abbot/go-http-auth - name: github.com/abbot/go-http-auth
version: cb4372376e1e00e9f6ab9ec142e029302c9e7140 version: cb4372376e1e00e9f6ab9ec142e029302c9e7140
- name: github.com/boltdb/bolt - name: github.com/boltdb/bolt
version: 5cc10bbbc5c141029940133bb33c9e969512a698 version: fff57c100f4dea1905678da7e90d92429dff2904
- name: github.com/BurntSushi/toml - name: github.com/BurntSushi/toml
version: 99064174e013895bbd9b025c31100bd1d9b590ca version: 99064174e013895bbd9b025c31100bd1d9b590ca
- name: github.com/BurntSushi/ty - name: github.com/BurntSushi/ty
version: 6add9cd6ad42d389d6ead1dde60b4ad71e46fd74 version: 6add9cd6ad42d389d6ead1dde60b4ad71e46fd74
subpackages: subpackages:
- fun - fun
- name: github.com/cenk/backoff
version: 8edc80b07f38c27352fb186d971c628a6c32552b
- name: github.com/codahale/hdrhistogram - name: github.com/codahale/hdrhistogram
version: f8ad88b59a584afeee9d334eff879b104439117b version: f8ad88b59a584afeee9d334eff879b104439117b
- name: github.com/codegangsta/cli - name: github.com/codegangsta/cli
version: 1efa31f08b9333f1bd4882d61f9d668a70cd902e version: d53eb991652b1d438abdd34ce4bfa3ef1539108e
- name: github.com/codegangsta/negroni - name: github.com/codegangsta/negroni
version: dc6b9d037e8dab60cbfc09c61d6932537829be8b version: 3f7ce7b928e14ff890b067e5bbbc80af73690a9c
- name: github.com/containous/flaeg - name: github.com/containous/flaeg
version: a731c034dda967333efce5f8d276aeff11f8ff87 version: a731c034dda967333efce5f8d276aeff11f8ff87
- name: github.com/containous/mux - name: github.com/containous/mux
@ -24,122 +26,122 @@ imports:
- name: github.com/containous/staert - name: github.com/containous/staert
version: 044bdfee6c8f5e8fb71f70d5ba1cf4cb11a94e97 version: 044bdfee6c8f5e8fb71f70d5ba1cf4cb11a94e97
- name: github.com/coreos/etcd - name: github.com/coreos/etcd
version: 1c9e0a0e33051fed6c05c141e6fcbfe5c7f2a899 version: a70513621cf914e2de4dbf90d8a0328e807ffd12
subpackages: subpackages:
- client - client
- pkg/pathutil - pkg/pathutil
- pkg/types - pkg/types
- name: github.com/davecgh/go-spew - name: github.com/davecgh/go-spew
version: 5215b55f46b2b919f50a1df0eaa5886afe4e3b3d version: 6d212800a42e8ab5c146b8ace3490ee17e5225f9
subpackages: subpackages:
- spew - spew
- name: github.com/docker/distribution - name: github.com/docker/distribution
version: 857d0f15c0a4d8037175642e0ca3660829551cb5 version: b6e0cfbdaa1ddc3a17c95142c7bf6e42c5567370
subpackages: subpackages:
- reference - context
- digest - digest
- reference
- registry/api/errcode - registry/api/errcode
- registry/api/v2
- registry/client
- registry/client/auth - registry/client/auth
- registry/client/transport - registry/client/transport
- registry/client
- context
- registry/api/v2
- registry/storage/cache - registry/storage/cache
- registry/storage/cache/memory - registry/storage/cache/memory
- uuid - uuid
- name: github.com/docker/docker - name: github.com/docker/docker
version: 534753663161334baba06f13b8efa4cad22b5bc5 version: 534753663161334baba06f13b8efa4cad22b5bc5
subpackages: subpackages:
- namesgenerator - api/types/backend
- pkg/namesgenerator - builder
- pkg/random - builder/dockerignore
- pkg/urlutil
- cliconfig - cliconfig
- cliconfig/configfile - cliconfig/configfile
- daemon/graphdriver
- image
- image/v1
- layer
- namesgenerator
- opts
- pkg/archive
- pkg/chrootarchive
- pkg/fileutils
- pkg/gitutils
- pkg/homedir
- pkg/httputils
- pkg/idtools
- pkg/ioutils
- pkg/jsonlog
- pkg/jsonmessage - pkg/jsonmessage
- pkg/longpath
- pkg/mflag
- pkg/mount
- pkg/namesgenerator
- pkg/plugins
- pkg/plugins/transport
- pkg/pools
- pkg/progress
- pkg/promise - pkg/promise
- pkg/random
- pkg/reexec
- pkg/signal
- pkg/stdcopy - pkg/stdcopy
- pkg/streamformatter
- pkg/stringid
- pkg/symlink
- pkg/system
- pkg/tarsum
- pkg/term - pkg/term
- pkg/term/windows
- pkg/urlutil
- reference - reference
- registry - registry
- runconfig/opts - runconfig/opts
- pkg/homedir
- pkg/jsonlog
- pkg/system
- pkg/term/windows
- image
- image/v1
- pkg/ioutils
- opts
- pkg/httputils
- pkg/mflag
- pkg/stringid
- pkg/tarsum
- pkg/mount
- pkg/signal
- builder
- builder/dockerignore
- pkg/archive
- pkg/fileutils
- pkg/progress
- pkg/streamformatter
- layer
- pkg/longpath
- api/types/backend
- pkg/chrootarchive
- pkg/gitutils
- pkg/symlink
- pkg/idtools
- pkg/pools
- daemon/graphdriver
- pkg/reexec
- pkg/plugins
- pkg/plugins/transport
- name: github.com/docker/engine-api - name: github.com/docker/engine-api
version: 62043eb79d581a32ea849645277023c550732e52 version: 62043eb79d581a32ea849645277023c550732e52
subpackages: subpackages:
- client - client
- types
- types/events
- types/filters
- types/container
- types/network
- client/transport - client/transport
- client/transport/cancellable - client/transport/cancellable
- types
- types/blkiodev
- types/container
- types/events
- types/filters
- types/network
- types/reference - types/reference
- types/registry - types/registry
- types/strslice
- types/swarm - types/swarm
- types/time - types/time
- types/versions - types/versions
- types/blkiodev
- types/strslice
- name: github.com/docker/go-connections - name: github.com/docker/go-connections
version: 990a1a1a70b0da4c4cb70e117971a4f0babfbf1a version: 988efe982fdecb46f01d53465878ff1f2ff411ce
subpackages: subpackages:
- nat
- sockets - sockets
- tlsconfig - tlsconfig
- nat
- name: github.com/docker/go-units - name: github.com/docker/go-units
version: f2d77a61e3c169b43402a0a1e84f06daf29b8190 version: f2145db703495b2e525c59662db69a7344b00bb8
- name: github.com/docker/libcompose - name: github.com/docker/libcompose
version: d1876c1d68527a49c0aac22a0b161acc7296b740 version: d1876c1d68527a49c0aac22a0b161acc7296b740
subpackages: subpackages:
- config - config
- docker - docker
- project
- project/events
- project/options
- utils
- yaml
- docker/builder - docker/builder
- docker/client - docker/client
- docker/network - docker/network
- labels - labels
- logger - logger
- lookup - lookup
- project
- project/events
- project/options
- utils
- version - version
- yaml
- name: github.com/docker/libkv - name: github.com/docker/libkv
version: aabc039ad04deb721e234f99cd1b4aa28ac71a40 version: 3fce6a0f26e07da3eac45796a8e255547a47a750
subpackages: subpackages:
- store - store
- store/boltdb - store/boltdb
@ -149,36 +151,33 @@ imports:
- name: github.com/donovanhide/eventsource - name: github.com/donovanhide/eventsource
version: fd1de70867126402be23c306e1ce32828455d85b version: fd1de70867126402be23c306e1ce32828455d85b
- name: github.com/elazarl/go-bindata-assetfs - name: github.com/elazarl/go-bindata-assetfs
version: 57eb5e1fc594ad4b0b1dbea7b286d299e0cb43c2 version: 9a6736ed45b44bf3835afeebb3034b57ed329f3e
- name: github.com/emilevauge/backoff
version: fa0423e7916ea96a4e9789a3710c8e7cb94ecc42
- name: github.com/gambol99/go-marathon - name: github.com/gambol99/go-marathon
version: a558128c87724cd7430060ef5aedf39f83937f55 version: a558128c87724cd7430060ef5aedf39f83937f55
- name: github.com/go-check/check - name: github.com/go-check/check
version: 4f90aeace3a26ad7021961c297b22c42160c7b25 version: 4f90aeace3a26ad7021961c297b22c42160c7b25
- name: github.com/gogo/protobuf - name: github.com/gogo/protobuf
version: e57a569e1882958f6b188cb42231d6db87701f2a version: a11c89fbb0ad4acfa8abc4a4d5f7e27c477169b1
subpackages: subpackages:
- proto - proto
- name: github.com/golang/glog - name: github.com/golang/glog
version: fca8c8854093a154ff1eb580aae10276ad6b1b5f version: 23def4e6c14b4da8ac2ed8007337bc5eb5007998
- name: github.com/google/go-querystring - name: github.com/google/go-querystring
version: 9235644dd9e52eeae6fa48efd539fdc351a0af53 version: 9235644dd9e52eeae6fa48efd539fdc351a0af53
subpackages: subpackages:
- query - query
- name: github.com/gorilla/context - name: github.com/gorilla/context
version: aed02d124ae4a0e94fea4541c8effd05bf0c8296 version: 08b5f424b9271eedf6f9f0ce86cb9396ed337a42
- name: github.com/hashicorp/consul - name: github.com/hashicorp/consul
version: fce7d75609a04eeb9d4bf41c8dc592aac18fc97d version: 67a03d57b5851011e5601ee6e7e3d05699548462
subpackages: subpackages:
- api - api
- name: github.com/hashicorp/go-cleanhttp - name: github.com/hashicorp/go-cleanhttp
version: 875fb671b3ddc66f8e2f0acc33829c8cb989a38d version: ad28ea4487f05916463e2423a55166280e8254b5
- name: github.com/hashicorp/serf - name: github.com/hashicorp/serf
version: 6c4672d66fc6312ddde18399262943e21175d831 version: 555e0dcbb180ecbd03431adc28226bb3192558bc
subpackages: subpackages:
- coordinate - coordinate
- serf
- name: github.com/jarcoal/httpmock - name: github.com/jarcoal/httpmock
version: 145b10d659265440f062c31ea15326166bae56ee version: 145b10d659265440f062c31ea15326166bae56ee
- name: github.com/libkermit/compose - name: github.com/libkermit/compose
@ -194,74 +193,74 @@ imports:
- name: github.com/mattn/go-shellwords - name: github.com/mattn/go-shellwords
version: 525bedee691b5a8df547cb5cf9f86b7fb1883e24 version: 525bedee691b5a8df547cb5cf9f86b7fb1883e24
- name: github.com/mesos/mesos-go - name: github.com/mesos/mesos-go
version: 068d5470506e3780189fe607af40892814197c5e version: 2b28dad0aa75289407717b98d82c7871543bb4db
subpackages: subpackages:
- mesosproto
- mesos
- upid
- mesosutil
- detector - detector
- detector/zoo - detector/zoo
- mesos
- mesosproto
- mesosutil
- upid
- name: github.com/mesosphere/mesos-dns - name: github.com/mesosphere/mesos-dns
version: b47dc4c19f215e98da687b15b4c64e70f629bea5 version: b47dc4c19f215e98da687b15b4c64e70f629bea5
repo: https://github.com/containous/mesos-dns.git repo: https://github.com/containous/mesos-dns.git
vcs: git vcs: git
subpackages: subpackages:
- detect - detect
- errorutil
- logging - logging
- models
- records - records
- records/labels
- records/state - records/state
- util - util
- errorutil
- models
- records/labels
- name: github.com/Microsoft/go-winio - name: github.com/Microsoft/go-winio
version: ce2922f643c8fd76b46cadc7f404a06282678b34 version: ce2922f643c8fd76b46cadc7f404a06282678b34
- name: github.com/miekg/dns - name: github.com/miekg/dns
version: 5d001d020961ae1c184f9f8152fdc73810481677 version: 5d001d020961ae1c184f9f8152fdc73810481677
- name: github.com/mitchellh/mapstructure - name: github.com/mitchellh/mapstructure
version: 21a35fb16463dfb7c8eee579c65d995d95e64d1e version: ca63d7c062ee3c9f34db231e352b60012b4fd0c1
- name: github.com/moul/http2curl - name: github.com/moul/http2curl
version: b1479103caacaa39319f75e7f57fc545287fca0d version: b1479103caacaa39319f75e7f57fc545287fca0d
- name: github.com/ogier/pflag - name: github.com/ogier/pflag
version: 45c278ab3607870051a2ea9040bb85fcb8557481 version: 45c278ab3607870051a2ea9040bb85fcb8557481
- name: github.com/opencontainers/runc - name: github.com/opencontainers/runc
version: ff88baa42fa5b2a1568a3a14665142fb4bdb3a2a version: 38e0df9ec67c05e73b656c02c9222f24c1683d73
subpackages: subpackages:
- libcontainer/user - libcontainer/user
- name: github.com/parnurzeal/gorequest - name: github.com/parnurzeal/gorequest
version: 045012d33ef41ea146c1b675df9296d0dc1a212d version: 29ced6f360a5ac3823a3675b4e29fbab336cc186
- name: github.com/pmezard/go-difflib - name: github.com/pmezard/go-difflib
version: d8ed2627bdf02c080bf22230dbb337003b7aba2d version: 792786c7400a136282c1664665ae0a8db921c6c2
subpackages: subpackages:
- difflib - difflib
- name: github.com/ryanuber/go-glob - name: github.com/ryanuber/go-glob
version: 572520ed46dbddaed19ea3d9541bdd0494163693 version: 572520ed46dbddaed19ea3d9541bdd0494163693
- name: github.com/samuel/go-zookeeper - name: github.com/samuel/go-zookeeper
version: e64db453f3512cade908163702045e0f31137843 version: 87e1bca4477a3cc767ca71be023ced183d74e538
subpackages: subpackages:
- zk - zk
- name: github.com/Sirupsen/logrus - name: github.com/Sirupsen/logrus
version: a283a10442df8dc09befd873fab202bf8a253d6a version: 3ec0642a7fb6488f65b06f9040adc67e3990296a
- name: github.com/streamrail/concurrent-map - name: github.com/streamrail/concurrent-map
version: 65a174a3a4188c0b7099acbc6cfa0c53628d3287 version: 8bf1e9bacbf65b10c81d0f4314cf2b1ebef728b5
- name: github.com/stretchr/objx - name: github.com/stretchr/objx
version: cbeaeb16a013161a98496fad62933b1d21786672 version: 1a9d0bb9f541897e62256577b352fdbc1fb4fd94
- name: github.com/stretchr/testify - name: github.com/stretchr/testify
version: d77da356e56a7428ad25149ca77381849a6a5232 version: d77da356e56a7428ad25149ca77381849a6a5232
subpackages: subpackages:
- mock
- assert - assert
- mock
- name: github.com/thoas/stats - name: github.com/thoas/stats
version: 79b768ff1780f4e5b0ed132e192bfeefe9f85a9c version: 152b5d051953fdb6e45f14b6826962aadc032324
- name: github.com/tv42/zbase32 - name: github.com/tv42/zbase32
version: 03389da7e0bf9844767f82690f4d68fc097a1306 version: 501572607d0273fc75b3b261fa4904d63f6ffa0e
- name: github.com/ugorji/go - name: github.com/ugorji/go
version: b94837a2404ab90efe9289e77a70694c355739cb version: 98ef79d6c615fa258e892ed0b11c6e013712693e
subpackages: subpackages:
- codec - codec
- name: github.com/unrolled/render - name: github.com/unrolled/render
version: 198ad4d8b8a4612176b804ca10555b222a086b40 version: 3f4913244021dede105b62caecfb01f0c1eebeda
- name: github.com/vdemeester/docker-events - name: github.com/vdemeester/docker-events
version: be74d4929ec1ad118df54349fda4b0cba60f849b version: be74d4929ec1ad118df54349fda4b0cba60f849b
- name: github.com/vdemeester/shakers - name: github.com/vdemeester/shakers
@ -274,50 +273,51 @@ imports:
- cbreaker - cbreaker
- connlimit - connlimit
- forward - forward
- memmetrics
- roundrobin - roundrobin
- stream - stream
- utils - utils
- memmetrics
- name: github.com/vulcand/predicate - name: github.com/vulcand/predicate
version: 19b9dde14240d94c804ae5736ad0e1de10bf8fe6 version: 19b9dde14240d94c804ae5736ad0e1de10bf8fe6
- name: github.com/vulcand/route - name: github.com/vulcand/route
version: cb89d787ddbb1c5849a7ac9f79004c1fd12a4a32 version: 61904570391bdf22252f8e376b49a57593d9124c
- name: github.com/vulcand/vulcand - name: github.com/vulcand/vulcand
version: 28a4e5c0892167589737b95ceecbcef00295be50 version: 7b479b160401beccbc9521b922588fa2a64c4818
subpackages: subpackages:
- plugin/rewrite
- plugin
- conntracker - conntracker
- plugin
- plugin/rewrite
- router - router
- name: github.com/xenolf/lego - name: github.com/xenolf/lego
version: b2fad6198110326662e9e356a97199078a4a775c version: b2fad6198110326662e9e356a97199078a4a775c
subpackages: subpackages:
- acme - acme
- name: golang.org/x/crypto - name: golang.org/x/crypto
version: d81fdb778bf2c40a91b24519d60cdc5767318829 version: 81372b2fc2f10bef2a7f338da115c315a56b2726
subpackages: subpackages:
- ocsp
- bcrypt - bcrypt
- blowfish - blowfish
- ocsp
- name: golang.org/x/net - name: golang.org/x/net
version: b400c2eff1badec7022a8c8f5bea058b6315eed7 version: 71a035914f99bb58fe82eac0f1289f10963d876c
subpackages: subpackages:
- context - context
- publicsuffix
- proxy - proxy
- publicsuffix
- name: golang.org/x/sys - name: golang.org/x/sys
version: 62bee037599929a6e9146f29d10dd5208c43507d version: 8f0908ab3b2457e2e15403d3697c9ef5cb4b57a9
subpackages: subpackages:
- unix - unix
- windows - windows
- name: gopkg.in/fsnotify.v1 - name: gopkg.in/fsnotify.v1
version: a8a77c9133d2d6fd8334f3260d06f60e8d80a5fb version: a8a77c9133d2d6fd8334f3260d06f60e8d80a5fb
- name: gopkg.in/mgo.v2 - name: gopkg.in/mgo.v2
version: 29cc868a5ca65f401ff318143f9408d02f4799cc version: 3f83fa5005286a7fe593b055f0d7771a7dce4655
subpackages: subpackages:
- bson - bson
- internal/json
- name: gopkg.in/square/go-jose.v1 - name: gopkg.in/square/go-jose.v1
version: e3f973b66b91445ec816dd7411ad1b6495a5a2fc version: 139276ceb5afbf13e636c44e9382f0ca75c12ba3
subpackages: subpackages:
- cipher - cipher
- json - json
@ -331,17 +331,17 @@ testImports:
- name: github.com/flynn/go-shlex - name: github.com/flynn/go-shlex
version: 3f9db97f856818214da2e1057f8ad84803971cff version: 3f9db97f856818214da2e1057f8ad84803971cff
- name: github.com/gorilla/mux - name: github.com/gorilla/mux
version: 9fa818a44c2bf1396a17f9d5a3c0f6dd39d2ff8e version: 0a192a193177452756c362c20087ddafcf6829c4
- name: github.com/libkermit/docker-check - name: github.com/libkermit/docker-check
version: cbe0ef03b3d23070eac4d00ba8828f2cc7f7e5a3 version: cbe0ef03b3d23070eac4d00ba8828f2cc7f7e5a3
- name: github.com/spf13/pflag - name: github.com/spf13/pflag
version: 5644820622454e71517561946e3d94b9f9db6842 version: c7e63cf4530bcd3ba943729cee0efeff2ebea63f
- name: github.com/vbatts/tar-split - name: github.com/vbatts/tar-split
version: 6810cedb21b2c3d0b9bb8f9af12ff2dc7a2f14df version: 6810cedb21b2c3d0b9bb8f9af12ff2dc7a2f14df
subpackages: subpackages:
- archive/tar
- tar/asm - tar/asm
- tar/storage - tar/storage
- archive/tar
- name: github.com/xeipuuv/gojsonpointer - name: github.com/xeipuuv/gojsonpointer
version: e0fe6f68307607d540ed8eac07a342c33fa1b54a version: e0fe6f68307607d540ed8eac07a342c33fa1b54a
- name: github.com/xeipuuv/gojsonreference - name: github.com/xeipuuv/gojsonreference

View file

@ -5,7 +5,7 @@ import:
subpackages: subpackages:
- fun - fun
- package: github.com/Sirupsen/logrus - package: github.com/Sirupsen/logrus
- package: github.com/emilevauge/backoff - package: github.com/cenk/backoff
- package: github.com/codegangsta/negroni - package: github.com/codegangsta/negroni
- package: github.com/containous/flaeg - package: github.com/containous/flaeg
version: a731c034dda967333efce5f8d276aeff11f8ff87 version: a731c034dda967333efce5f8d276aeff11f8ff87

View file

@ -2,7 +2,7 @@ package utils
import ( import (
"errors" "errors"
"github.com/emilevauge/backoff" "github.com/cenk/backoff"
"net/http" "net/http"
"strconv" "strconv"
"time" "time"

39
job/job.go Normal file
View file

@ -0,0 +1,39 @@
package job
import (
"github.com/cenk/backoff"
"time"
)
var (
_ backoff.BackOff = (*BackOff)(nil)
)
const (
defaultMinJobInterval = 30 * time.Second
)
// BackOff is an exponential backoff implementation for long running jobs.
// In long running jobs, an operation() that fails after a long Duration should not increments the backoff period.
// If operation() takes more than MinJobInterval, Reset() is called in NextBackOff().
type BackOff struct {
*backoff.ExponentialBackOff
MinJobInterval time.Duration
}
// NewBackOff creates an instance of BackOff using default values.
func NewBackOff(backOff *backoff.ExponentialBackOff) *BackOff {
backOff.MaxElapsedTime = 0
return &BackOff{
ExponentialBackOff: backOff,
MinJobInterval: defaultMinJobInterval,
}
}
// NextBackOff calculates the next backoff interval.
func (b *BackOff) NextBackOff() time.Duration {
if b.GetElapsedTime() >= b.MinJobInterval {
b.Reset()
}
return b.ExponentialBackOff.NextBackOff()
}

44
job/job_test.go Normal file
View file

@ -0,0 +1,44 @@
package job
import (
"github.com/cenk/backoff"
"testing"
"time"
)
func TestJobBackOff(t *testing.T) {
var (
testInitialInterval = 500 * time.Millisecond
testRandomizationFactor = 0.1
testMultiplier = 2.0
testMaxInterval = 5 * time.Second
testMinJobInterval = 1 * time.Second
)
exp := NewBackOff(backoff.NewExponentialBackOff())
exp.InitialInterval = testInitialInterval
exp.RandomizationFactor = testRandomizationFactor
exp.Multiplier = testMultiplier
exp.MaxInterval = testMaxInterval
exp.MinJobInterval = testMinJobInterval
exp.Reset()
var expectedResults = []time.Duration{500, 500, 500, 1000, 2000, 4000, 5000, 5000, 500, 1000, 2000, 4000, 5000, 5000}
for i, d := range expectedResults {
expectedResults[i] = d * time.Millisecond
}
for i, expected := range expectedResults {
// Assert that the next backoff falls in the expected range.
var minInterval = expected - time.Duration(testRandomizationFactor*float64(expected))
var maxInterval = expected + time.Duration(testRandomizationFactor*float64(expected))
if i < 3 || i == 8 {
time.Sleep(2 * time.Second)
}
var actualInterval = exp.NextBackOff()
if !(minInterval <= actualInterval && actualInterval <= maxInterval) {
t.Error("error")
}
// assertEquals(t, expected, exp.currentInterval)
}
}

View file

@ -10,9 +10,10 @@ import (
"github.com/BurntSushi/ty/fun" "github.com/BurntSushi/ty/fun"
log "github.com/Sirupsen/logrus" log "github.com/Sirupsen/logrus"
"github.com/cenk/backoff"
"github.com/containous/traefik/job"
"github.com/containous/traefik/safe" "github.com/containous/traefik/safe"
"github.com/containous/traefik/types" "github.com/containous/traefik/types"
"github.com/emilevauge/backoff"
"github.com/hashicorp/consul/api" "github.com/hashicorp/consul/api"
) )
@ -330,7 +331,7 @@ func (provider *ConsulCatalog) Provide(configurationChan chan<- types.ConfigMess
operation := func() error { operation := func() error {
return provider.watch(configurationChan, stop) return provider.watch(configurationChan, stop)
} }
err := backoff.RetryNotify(operation, backoff.NewJobBackOff(backoff.NewExponentialBackOff()), notify) err := backoff.RetryNotify(operation, job.NewBackOff(backoff.NewExponentialBackOff()), notify)
if err != nil { if err != nil {
log.Errorf("Cannot connect to consul server %+v", err) log.Errorf("Cannot connect to consul server %+v", err)
} }

View file

@ -14,6 +14,8 @@ import (
"github.com/BurntSushi/ty/fun" "github.com/BurntSushi/ty/fun"
log "github.com/Sirupsen/logrus" log "github.com/Sirupsen/logrus"
"github.com/cenk/backoff"
"github.com/containous/traefik/job"
"github.com/containous/traefik/safe" "github.com/containous/traefik/safe"
"github.com/containous/traefik/types" "github.com/containous/traefik/types"
"github.com/containous/traefik/version" "github.com/containous/traefik/version"
@ -26,7 +28,6 @@ import (
swarmtypes "github.com/docker/engine-api/types/swarm" swarmtypes "github.com/docker/engine-api/types/swarm"
"github.com/docker/go-connections/nat" "github.com/docker/go-connections/nat"
"github.com/docker/go-connections/sockets" "github.com/docker/go-connections/sockets"
"github.com/emilevauge/backoff"
"github.com/vdemeester/docker-events" "github.com/vdemeester/docker-events"
) )
@ -223,7 +224,7 @@ func (provider *Docker) Provide(configurationChan chan<- types.ConfigMessage, po
notify := func(err error, time time.Duration) { notify := func(err error, time time.Duration) {
log.Errorf("Docker connection error %+v, retrying in %s", err, time) log.Errorf("Docker connection error %+v, retrying in %s", err, time)
} }
err := backoff.RetryNotify(operation, backoff.NewJobBackOff(backoff.NewExponentialBackOff()), notify) err := backoff.RetryNotify(operation, job.NewBackOff(backoff.NewExponentialBackOff()), notify)
if err != nil { if err != nil {
log.Errorf("Cannot connect to docker server %+v", err) log.Errorf("Cannot connect to docker server %+v", err)
} }

View file

@ -11,10 +11,11 @@ import (
"time" "time"
log "github.com/Sirupsen/logrus" log "github.com/Sirupsen/logrus"
"github.com/cenk/backoff"
"github.com/containous/traefik/job"
"github.com/containous/traefik/provider/k8s" "github.com/containous/traefik/provider/k8s"
"github.com/containous/traefik/safe" "github.com/containous/traefik/safe"
"github.com/containous/traefik/types" "github.com/containous/traefik/types"
"github.com/emilevauge/backoff"
) )
const ( const (
@ -146,7 +147,7 @@ func (provider *Kubernetes) Provide(configurationChan chan<- types.ConfigMessage
notify := func(err error, time time.Duration) { notify := func(err error, time time.Duration) {
log.Errorf("Kubernetes connection error %+v, retrying in %s", err, time) log.Errorf("Kubernetes connection error %+v, retrying in %s", err, time)
} }
err := backoff.RetryNotify(operation, backoff.NewJobBackOff(backoff.NewExponentialBackOff()), notify) err := backoff.RetryNotify(operation, job.NewBackOff(backoff.NewExponentialBackOff()), notify)
if err != nil { if err != nil {
log.Errorf("Cannot connect to Kubernetes server %+v", err) log.Errorf("Cannot connect to Kubernetes server %+v", err)
} }

View file

@ -10,11 +10,12 @@ import (
"errors" "errors"
"github.com/BurntSushi/ty/fun" "github.com/BurntSushi/ty/fun"
log "github.com/Sirupsen/logrus" log "github.com/Sirupsen/logrus"
"github.com/cenk/backoff"
"github.com/containous/traefik/job"
"github.com/containous/traefik/safe" "github.com/containous/traefik/safe"
"github.com/containous/traefik/types" "github.com/containous/traefik/types"
"github.com/docker/libkv" "github.com/docker/libkv"
"github.com/docker/libkv/store" "github.com/docker/libkv/store"
"github.com/emilevauge/backoff"
) )
// Kv holds common configurations of key-value providers. // Kv holds common configurations of key-value providers.
@ -75,7 +76,7 @@ func (provider *Kv) watchKv(configurationChan chan<- types.ConfigMessage, prefix
notify := func(err error, time time.Duration) { notify := func(err error, time time.Duration) {
log.Errorf("KV connection error: %+v, retrying in %s", err, time) log.Errorf("KV connection error: %+v, retrying in %s", err, time)
} }
err := backoff.RetryNotify(operation, backoff.NewJobBackOff(backoff.NewExponentialBackOff()), notify) err := backoff.RetryNotify(operation, job.NewBackOff(backoff.NewExponentialBackOff()), notify)
if err != nil { if err != nil {
return fmt.Errorf("Cannot connect to KV server: %v", err) return fmt.Errorf("Cannot connect to KV server: %v", err)
} }
@ -106,7 +107,7 @@ func (provider *Kv) provide(configurationChan chan<- types.ConfigMessage, pool *
notify := func(err error, time time.Duration) { notify := func(err error, time time.Duration) {
log.Errorf("KV connection error: %+v, retrying in %s", err, time) log.Errorf("KV connection error: %+v, retrying in %s", err, time)
} }
err := backoff.RetryNotify(operation, backoff.NewJobBackOff(backoff.NewExponentialBackOff()), notify) err := backoff.RetryNotify(operation, job.NewBackOff(backoff.NewExponentialBackOff()), notify)
if err != nil { if err != nil {
return fmt.Errorf("Cannot connect to KV server: %v", err) return fmt.Errorf("Cannot connect to KV server: %v", err)
} }

View file

@ -14,9 +14,10 @@ import (
"github.com/BurntSushi/ty/fun" "github.com/BurntSushi/ty/fun"
log "github.com/Sirupsen/logrus" log "github.com/Sirupsen/logrus"
"github.com/cenk/backoff"
"github.com/containous/traefik/job"
"github.com/containous/traefik/safe" "github.com/containous/traefik/safe"
"github.com/containous/traefik/types" "github.com/containous/traefik/types"
"github.com/emilevauge/backoff"
"github.com/gambol99/go-marathon" "github.com/gambol99/go-marathon"
) )
@ -110,7 +111,7 @@ func (provider *Marathon) Provide(configurationChan chan<- types.ConfigMessage,
notify := func(err error, time time.Duration) { notify := func(err error, time time.Duration) {
log.Errorf("Marathon connection error %+v, retrying in %s", err, time) log.Errorf("Marathon connection error %+v, retrying in %s", err, time)
} }
err := backoff.RetryNotify(operation, backoff.NewJobBackOff(backoff.NewExponentialBackOff()), notify) err := backoff.RetryNotify(operation, job.NewBackOff(backoff.NewExponentialBackOff()), notify)
if err != nil { if err != nil {
log.Errorf("Cannot connect to Marathon server %+v", err) log.Errorf("Cannot connect to Marathon server %+v", err)
} }

View file

@ -9,9 +9,10 @@ import (
"fmt" "fmt"
"github.com/BurntSushi/ty/fun" "github.com/BurntSushi/ty/fun"
log "github.com/Sirupsen/logrus" log "github.com/Sirupsen/logrus"
"github.com/cenk/backoff"
"github.com/containous/traefik/job"
"github.com/containous/traefik/safe" "github.com/containous/traefik/safe"
"github.com/containous/traefik/types" "github.com/containous/traefik/types"
"github.com/emilevauge/backoff"
"github.com/mesos/mesos-go/detector" "github.com/mesos/mesos-go/detector"
_ "github.com/mesos/mesos-go/detector/zoo" // Registers the ZK detector _ "github.com/mesos/mesos-go/detector/zoo" // Registers the ZK detector
"github.com/mesosphere/mesos-dns/detect" "github.com/mesosphere/mesos-dns/detect"
@ -110,7 +111,7 @@ func (provider *Mesos) Provide(configurationChan chan<- types.ConfigMessage, poo
notify := func(err error, time time.Duration) { notify := func(err error, time time.Duration) {
log.Errorf("mesos connection error %+v, retrying in %s", err, time) log.Errorf("mesos connection error %+v, retrying in %s", err, time)
} }
err := backoff.RetryNotify(operation, backoff.NewJobBackOff(backoff.NewExponentialBackOff()), notify) err := backoff.RetryNotify(operation, job.NewBackOff(backoff.NewExponentialBackOff()), notify)
if err != nil { if err != nil {
log.Errorf("Cannot connect to mesos server %+v", err) log.Errorf("Cannot connect to mesos server %+v", err)
} }

View file

@ -62,6 +62,32 @@
# #
# defaultEntryPoints = ["http", "https"] # defaultEntryPoints = ["http", "https"]
# Constraints definition
#
# Optional
#
# Simple matching constraint
# constraints = ["tag==api"]
#
# Simple mismatching constraint
# constraints = ["tag!=api"]
#
# Globbing
# constraints = ["tag==us-*"]
#
# Backend-specific constraint
# [consulCatalog]
# endpoint = 127.0.0.1:8500
# constraints = ["tag==api"]
#
# Multiple constraints
# - "tag==" must match with at least one tag
# - "tag!=" must match with none of tags
# constraints = ["tag!=us-*", "tag!=asia-*"]
# [consulCatalog]
# endpoint = 127.0.0.1:8500
# constraints = ["tag==api", "tag!=v*-beta"]
# Enable ACME (Let's Encrypt): automatic SSL # Enable ACME (Let's Encrypt): automatic SSL
# #
# Optional # Optional
@ -370,6 +396,14 @@
# key = "/etc/ssl/docker.key" # key = "/etc/ssl/docker.key"
# insecureskipverify = true # insecureskipverify = true
# Constraints
#
# Optional
#
# constraints = ["tag==api", "tag==he*ld"]
# Matching with containers having the label "traefik.tags" set to "api,helloworld"
# ex: $ docker run -d -P --label traefik.tags=api,helloworld emilevauge/whoami
################################################################ ################################################################
# Mesos/Marathon configuration backend # Mesos/Marathon configuration backend
@ -578,6 +612,40 @@
# key = "/etc/ssl/consul.key" # key = "/etc/ssl/consul.key"
# insecureskipverify = true # insecureskipverify = true
################################################################
# Consul Catalog configuration backend
################################################################
# Enable Consul Catalog configuration backend
#
# Optional
#
# [consulCatalog]
# Consul server endpoint
#
# Required
#
# endpoint = "127.0.0.1:8500"
# Default domain used.
#
# Optional
#
# domain = "consul.localhost"
# Prefix for Consul catalog tags
#
# Optional
#
# prefix = "traefik"
# Constraints
#
# Optional
#
# constraints = ["tag==api", "tag==he*ld"]
# Matching with containers having this tag: "traefik.tags=api,helloworld"
################################################################ ################################################################
# Etcd configuration backend # Etcd configuration backend

View file

@ -139,6 +139,13 @@ func (c *Constraint) String() string {
return c.Key + "!=" + c.Regex return c.Key + "!=" + c.Regex
} }
// UnmarshalText define how unmarshal in TOML parsing
func (c *Constraint) UnmarshalText(text []byte) error {
constraint, err := NewConstraint(string(text))
*c = *constraint
return err
}
// MatchConstraintWithAtLeastOneTag tests a constraint for one single service // MatchConstraintWithAtLeastOneTag tests a constraint for one single service
func (c *Constraint) MatchConstraintWithAtLeastOneTag(tags []string) bool { func (c *Constraint) MatchConstraintWithAtLeastOneTag(tags []string) bool {
for _, tag := range tags { for _, tag := range tags {

33
web.go
View file

@ -107,38 +107,25 @@ func (provider *WebProvider) Provide(configurationChan chan<- types.ConfigMessag
} }
go func() { go func() {
var err error
var negroni = negroni.New()
if provider.Auth != nil { if provider.Auth != nil {
authMiddleware, err := middlewares.NewAuthenticator(provider.Auth) authMiddleware, err := middlewares.NewAuthenticator(provider.Auth)
if err != nil { if err != nil {
log.Fatal("Error creating Auth: ", err) log.Fatal("Error creating Auth: ", err)
} }
var negroni = negroni.New()
negroni.Use(authMiddleware) negroni.Use(authMiddleware)
negroni.UseHandler(systemRouter) }
negroni.UseHandler(systemRouter)
if len(provider.CertFile) > 0 && len(provider.KeyFile) > 0 { if len(provider.CertFile) > 0 && len(provider.KeyFile) > 0 {
err = http.ListenAndServeTLS(provider.Address, provider.CertFile, provider.KeyFile, negroni) err = http.ListenAndServeTLS(provider.Address, provider.CertFile, provider.KeyFile, negroni)
} else {
err = http.ListenAndServe(provider.Address, negroni)
}
if err != nil {
log.Fatal("Error creating server with Auth: ", err)
}
} else { } else {
err = http.ListenAndServe(provider.Address, negroni)
}
var err error if err != nil {
log.Fatal("Error creating server: ", err)
if len(provider.CertFile) > 0 && len(provider.KeyFile) > 0 {
err = http.ListenAndServeTLS(provider.Address, provider.CertFile, provider.KeyFile, systemRouter)
} else {
err = http.ListenAndServe(provider.Address, systemRouter)
}
if err != nil {
log.Fatal("Error creating server without Auth: ", err)
}
} }
}() }()
return nil return nil