Commit graph

67 commits

Author SHA1 Message Date
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
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
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
Ed Robinson 6f4c5dd4ce
Upgrade k8s.io/client-go to version 2 2017-04-07 11:52:18 +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
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 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 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
Brian Akins 225dbcce0a Allow setting circuitbreaker expression via Kubernetes annotation (#1056) 2017-02-03 17:47:48 +01:00
Emile Vauge 5a67d0ac84
Fix panic in k8s loadIngresses
Signed-off-by: Emile Vauge <emile@vauge.com>
2017-02-03 09:46:27 +01:00
Emile Vauge be362f0d9f
Add Operation with recover 2017-02-03 09:46:27 +01:00
Brian Akins 490427f94d
Allow setting load balancer method and sticky using service annotations 2017-02-02 14:03:39 +00:00
Timo Reimann 3a7de0be5c Add missing fmt verb specifier in k8s provider. 2017-01-26 11:05:13 +01:00
Adam Stankiewicz d15a17b634 Allow for wildcards in k8s ingress host, fixes #792 (#1029) 2017-01-20 14:16:05 +01:00
Vincent Demeester 8a348423ae Import order as goimports does
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-12-30 19:04:02 +01:00
Yves Peter fc788eb426 Kubernetes: cleanup channel handling
Only use one channel for all watches
Re-use stop channel from the provider
Skip events that have already been handled by the provider, builds on 007f8cc48ea9504bb7754c5e3244124be422f47d
2016-12-07 20:12:14 +01:00
Emile Vauge dca08af003
Merge v1.1.1 into master
Signed-off-by: Emile Vauge <emile@vauge.com>
2016-12-06 08:44:23 +01:00
yvespp 7f4eddf6d6 k8s: changed debug log, removed unneeded stop channels, increased watch channel buffer 2016-11-30 19:16:48 +01:00
Yves Peter 15540764a0 Switched Kubernetes provider to new client implementation: https://github.com/kubernetes/client-go 2016-11-30 19:16:48 +01:00
Kristian Klausen a8cb905255 consul/kv.tmpl: weight default value should be a int (#826)
* consul/kv.tmpl: weight default value should be a int

Fix #821

* Use 0 as default weight in all backends
2016-11-23 14:49:55 +01:00
Emile Vauge 2dda3d2feb
Fix Kubernetes watch leak
Signed-off-by: Emile Vauge <emile@vauge.com>
2016-11-17 17:37:06 +01:00
Emile Vauge c9cc3c9895
Fix contraint store/read from KV
Signed-off-by: Emile Vauge <emile@vauge.com>
2016-11-09 21:08:37 +01:00
Emile Vauge e72e65858f
Challenge certs PEM encoding
Signed-off-by: Emile Vauge <emile@vauge.com>
2016-09-30 11:26:25 +02:00
Emile Vauge a42845502e
Add ACME store
Signed-off-by: Emile Vauge <emile@vauge.com>
2016-09-30 11:26:17 +02:00
Emile Vauge 5a0440d6f8
Add KV datastore
Signed-off-by: Emile Vauge <emile@vauge.com>
2016-09-30 11:26:05 +02:00
Emile Vauge 364958cbaf
Move jobs backoff back into traefik
https://github.com/cenk/backoff/pull/27#issuecomment-245842725
2016-09-27 21:45:29 +02:00
Yves Peter 1a20e9f9b4 Kubernetes provider: don't log a warning if traefik.frontend.rule.type is empty, log namespace and ingress if invalide. 2016-09-12 21:06:21 +02:00
Emile Vauge d340ccd601
Migrate to JobBackOff 2016-08-19 14:24:09 +02:00
Emile Vauge 97ddfcb17a
Use long job RetryBackoff in providers 2016-08-19 11:09:54 +02:00
Emile Vauge 11297b38c5
Remove misused Fatal* 2016-08-19 10:36:54 +02:00
Ed Robinson d4f190e995
Name servers after thier pods
The TargetRef contains information from the object referenced
by the pod, unless the service has been set up with bare
endpoints - i.e. not pointing at pods this information
will be present.

It just makes the information that we show in the web-ui
a little more constent with that shown in kubectl
and the kuberntes dashboard.
2016-08-06 20:40:40 +01:00
Phil Kates 79dd72f53d
Prioritize kubernetes routes by path length
The Kubernetes provider wasn't setting priorities which was causing
shorter paths to get chosen before longer ones. This now matches the
[documentation](https://github.com/containous/traefik/blob/master/docs/basics.md#priorities)
2016-08-03 11:37:22 -07:00
Martin 056e0fe2d9 Use KvStores as global config source 2016-07-21 09:22:35 +02:00
Parham Negahdar 9f6484a328 Fixes #363: Allow for kubernetes label selectors 2016-07-12 17:50:01 -04:00
Parham Negahdar 40c0ed092e Fixes #501: prioritize kube.endpoint passed via cli 2016-07-11 15:39:20 -04:00
Emile Vauge 606e667b88
Fix spamming events in listenProviders
Signed-off-by: Emile Vauge <emile@vauge.com>
2016-06-23 16:33:54 +02:00
Samuel BERTHE 1de5434e1a refacto(constraints): Migration to Flaeg cli library 2016-06-01 10:30:34 +02:00
Samuel BERTHE ac087921d8 feat(constraints): Implementation of constraint filtering (cmd + toml + matching functions), implementation proposal with consul 2016-06-01 10:30:34 +02:00
Martin 6752b49536 rm useless StrucTag 2016-05-27 10:06:19 +02:00
Martin 414fb1f406 add kubernetes.Namespaces parser 2016-05-27 10:06:19 +02:00
Martin fe0a8f3363 Flaeg integration 2016-05-27 10:06:19 +02:00
Ed Robinson 6accb90c47
Simplify Service Lookup
Since we already know the name and namespace
of the service(s) we want we can just get the
correct one back from the API without filtering
the results.
2016-05-26 11:17:38 +01:00
Ed Robinson e948a013cd
Build backend config using the K8S endpoint resource.
* Potentialy saves a network hop
* Ability to configure LB algothim (given some work to expose an
anotation etc...)
* K8s config Watch is triggered far less often
2016-05-26 10:52:30 +01:00