Commit graph

241 commits

Author SHA1 Message Date
mattcollier 8764c43eaf Fix typo in command line help. 2017-04-21 14:01:45 +02:00
Manuel Laufenberg 8a892b21e1 Add Basic Auth per Frontend for Rancher & Docker Dynamic Provider 2017-04-19 21:05:43 +02:00
Martin Baillie d1ee72b308
Merge branch 'master' into rancher-provider-pagination-fixes 2017-04-19 20:47:30 +10:00
Vincent Demeester 542c3673e4 Extract providers to their own package
This is just doing that and making it compile :)

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-04-18 13:24:17 +02:00
Martin Baillie 73f09f389e Fix Rancher API pagination limits
This fix allows the Traefik Rancher provider to obtain a complete view
of the environments, services and containers being managed by the
Rancher deployment.
2017-04-18 19:48:43 +10:00
Vincent Demeester b04ba36682 Update some docker provider test
- Split the file into smaller ones (docker, swarm and service tests)
- Use some builder to reduce a little bit the noise for creating containers

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-04-17 15:40:55 +02:00
Vincent Demeester 3f293ee25b Move docker provider to its own package 👼
Makes it simpler to manage :)

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-04-17 15:40:55 +02:00
Emile Vauge aeb17182b4
Merge v1.2.1-master
Signed-off-by: Emile Vauge <emile@vauge.com>
2017-04-11 22:36:56 +02:00
Timo Reimann f2297dd3ed
k8s: Do not log service fields when GetService is failing.
Update tests too.
2017-04-11 22:36:55 +02:00
Emile Vauge 6edc0926eb
sub-tests + Fatalf/Errorf
Signed-off-by: Emile Vauge <emile@vauge.com>
2017-04-11 22:36:55 +02:00
Emile Vauge a456d36cc6
Add Docker task list test
Signed-off-by: Emile Vauge <emile@vauge.com>
2017-04-11 22:36:55 +02:00
yshay 5c2d91ab84
Add check on task status in addition to desired status 2017-04-11 22:36:55 +02:00
Sebastian a73fee50dc
Docker: Added warning if network could not be found (#1310)
* Added warning if network could not be found

* Removed regex import from master

* Corrected wrong function call
2017-04-11 22:36:55 +02:00
Regner Blok-Andersen b02393915e
Abort Kubernetes Ingress update if Kubernetes API call fails (#1295)
* Abort Kubernetes Ingress update if Kubernetes API call fails

Currently if a Kubernetes API call fails we potentially remove a working service from Traefik. This changes it so if a Kubernetes API call fails we abort out of the ingress update and use the current working config. Github issue: #1240

Also added a test to cover when requested resources (services and endpoints) that the user has specified don’t exist.

* Specifically capturing the tc range as documented here: https://blog.golang.org/subtests

* Updating service names in the mock data to be more clear

* Updated expected data to match what currently happens in the loadIngress

* Adding a blank Servers to the expected output so we compare against that instead of nil.

* Replacing the JSON test output with spew for the TestMissingResources test to help ensure we have useful output incase of failures

* Adding a temporary fix to the GetEndoints mocked function so we can override the return value for if the endpoints exist.

After the 1.2 release the use of properExists should be removed and the GetEndpoints function should return false for the second value indicating the endpoint doesn’t exist. However at this time that would break a lot of the tests.

* Adding quick TODO line about removing the properExists property

* Link to issue 1307 re: properExists flag.
2017-04-11 22:36:55 +02:00
Emile Vauge b99a919bb4
Refactor k8s client config
Signed-off-by: Emile Vauge <emile@vauge.com>
2017-04-11 22:36:55 +02:00
Owen Marshall c876462eb0
Chunk taskArns into groups of 100
If the ECS cluster has > 100 tasks, passing them to
ecs.DescribeTasksRequest() will result in the AWS API returning
errors.

This patch breaks them into chunks of at most 100, and calls
DescribeTasks for each chunk.

We also return early in case ListTasks returns no values; this
prevents DescribeTasks from throwing HTTP errors.
2017-04-11 22:36:55 +02:00
Ed Robinson 6f4c5dd4ce
Upgrade k8s.io/client-go to version 2 2017-04-07 11:52:18 +01:00
Nic Grayson 4eb779e596
Allow traefik.port to not be in the list of marathon ports 2017-04-06 18:47:35 +02:00
Kristian Klausen b4dfb7223b
kv: Extend test with support for specifying custom error for Get/List 2017-04-06 10:28:11 +02:00
Kristian Klausen f621a46a2e
kv: Log error when checking existence of server url key 2017-04-06 10:28:11 +02:00
Kristian Klausen c864d80270
kv: Add test for server without url key 2017-04-06 10:28:11 +02:00
Kristian Klausen 020a8e31ab
kv: Ignore backend servers with no url
Currently with a kv tree like:
/traefik/backends/b1/servers/ẁeb1
/traefik/backends/b1/servers/web2
/traefik/backends/b1/servers/web2/url
Traefik would try to forward traffic to web1, which is impossible as
traefik doesn't know the url of web1.

This commit solve that, by ignoring backend server with no url "key"
when generating the config.

This is very useful, for people who use etcd TTL feature. They can then
just "renew" the url key every X second, and if the server goes down, it
is automatic removed from traefik after the TTL.
2017-04-06 10:28:11 +02:00
Timo Reimann 056fe9ac0a Switch duration configuration parameters over to flaeg.Duration. 2017-04-03 18:36:23 +02:00
tcoupin 5c16860486
Use service.project.domain instead of project-service.domain 2017-04-03 11:00:04 +02:00
tcoupin 0a7f9b5a71
Use docker-compose labels for frontend and backend names 2017-04-03 11:00:04 +02:00
Taylor Skinner 72e35af39f add dynamo
Signed-off-by: Taylor Skinner <tskinn12@gmail.com>

add some comments

Signed-off-by: Taylor Skinner <tskinn12@gmail.com>

update readmes

make test runnable

Signed-off-by: Taylor Skinner <tskinn12@gmail.com>

make test

squash! add dynamo

add glide.lock

format imports

gofmt

update glide.lock

fixes for review

golint

clean up and reorganize tests

add dynamodb integration test

remove default region. clean up tests. consistent docs

forgot the region is required

DRY

make validate

update readme and commit dependencies
2017-03-16 10:12:26 -06:00
Florent BENOIT 1158eba7ac Adding docker labels traefik.<servicename>.* properties like
- traefik.mycustomservice.port=443
  -  traefik.mycustomservice.frontend.rule=Path:/mycustomservice
   - traefik.anothercustomservice.port=8080
  -  traefik.anothercustomservice.frontend.rule=Path:/anotherservice

all traffic to frontend /mycustomservice is redirected to the port 443 of the container while using /anotherservice will redirect to the port 8080 of the docker container

More documentation in the docs/toml.md file

Change-Id: Ifaa3bb00ef0a0f38aa189e0ca1586fde8c5ed862
Signed-off-by: Florent BENOIT <fbenoit@codenvy.com>
2017-03-14 08:45:47 +01:00
Timo Reimann 920b5bb15d Support cluster-external Kubernetes client. (#1159)
Detect whether in-cluster or cluster-external Kubernetes client should
be used based on the KUBERNETES_SERVICE_{HOST,PORT} environment
variables.

Adds bearer token and CA certificate file path parameters.
2017-03-07 13:09:11 +01:00
Bruce Lee aa75d5458d
Revert "Ensure that we don't add balancees with no health check runs if there is a health check defined on it"
This reverts commit ad12a7264e.
2017-03-06 17:45:58 +01:00
Christophe Robin 4172a7c62e
Add task parser unit test for docker provider 2017-03-06 17:45:58 +01:00
Christophe Robin 355b4706d3
Fix docker issues with global and dead tasks 2017-03-06 17:45:58 +01:00
Manuel Laufenberg eb1ffae01b
Small fixes and improvments 2017-03-06 17:45:58 +01:00
Luke Petre c786bbbc5b
Try harder to query all the possible ec2 instances, and filter on instance state / lack of IP address 2017-03-06 17:45:58 +01:00
Regner Blok-Andersen f530284031 Adding support for Traefik to respect the K8s ingress class annotation (#1182) 2017-03-03 20:30:22 +01:00
Timo Reimann f3598e6b0f Refactor k8s rule type annotation parsing/retrieval.
- Move annotation logic into function.
- Constantify strings.
- Refactor TestRuleType.
- Add test for GetRuleTypeFromAnnotations.
2017-03-03 13:33:00 +01:00
Regner Blok-Andersen 1e10fc2e30 Simplifying else if statement to be cleaner 2017-02-14 14:57:09 -08:00
Regner Blok-Andersen c8cf5f8c44 Added a test to make sure passing an invalid value to traefik.frontend.passHostHeader results in falling back correctly. 2017-02-14 11:54:27 -08:00
Regner Blok-Andersen 96e6c9cef2 Split the if/or statement when requesting endpoints from the k8s service so that it now provides two unique log statements. 2017-02-14 11:53:35 -08:00
Regner Blok-Andersen 931ee55e1d Added default case for PassHostHeader that logs a warning. 2017-02-14 11:52:54 -08:00
Regner Blok-Andersen 4d3aede5d3 Added tests for ingress passHostHeader annotation 2017-02-10 03:27:30 -08:00
Regner Blok-Andersen 0b1dd69b01 Added support for passHostHeader annotation on ingresses 2017-02-10 03:05:59 -08:00
Regner Blok-Andersen 0947aa901e Initial support for Kubernetes ExternalName service type 2017-02-09 17:25:38 -08:00
Manuel Laufenberg 3a875e2954 add default config
lint files
2017-02-06 17:03:43 +01:00
Manuel Laufenberg bdb63ac785 add watch function 2017-02-06 17:03:43 +01:00
Manuel Laufenberg 9a5dc54f85 add some unit tests
fmt & lint
2017-02-06 17:03:41 +01:00
Manuel Laufenberg 48524a58ff fix all containers - no matter of pagination
fmt & lint
2017-02-06 17:03:38 +01:00
Manuel Laufenberg 38bd49b97e add dependency, start provider and fetch data
add tons of labels

Provide - WIP

add rancher data over rancher types

first version of direct fetch - pagination still an issue
2017-02-06 17:02:53 +01:00
WTFKr0 41f8f0113b
Replace underscores to dash in autogenerated urls (docker provider)
Signed-off-by: WTFKr0 <thomas.kovatchitch@gmail.com>
2017-02-06 15:38:18 +01:00
Mike Foley e0a4c58081
Added service name to dockerData struct.
In Swarm mode with with Docker Swarm’s Load Balancer disabled (traefik.backend.loadbalancer.swarm=false)
service name will be the name of the docker service and name will be the container task name
(e.g. whoami0.1).  When generating backend and fronted rules, we will use service name instead of name if a
rule is not provided.

Initialize dockerData.ServiceName to dockerData.Name to support non-swarm mode.
2017-02-06 14:44:25 +01:00
Mike Foley d2b47a5681
Support sticky sessions under SWARM Mode.
SWARM Mode has it's own built in Load balancer, so if we want to leverage sticky sessions,
 or if we would just prefer to bypass it and go directly to the containers (aka tasks), via
	--label traefik.backend.disable.swarm.loadbalancer=true
 then we need to let Traefik know about the underlying tasks and register them as
 services within it's backend.
2017-02-06 14:44:25 +01:00