Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting load balancer method and sticky using service annotations #1068

Merged

Conversation

bakins
Copy link
Contributor

@bakins bakins commented Jan 25, 2017

My take on #940 - slightly modified.

As we are setting backend behavior, I think the annotations should be on the backend - the Kubernetes service.

Includes unit tests for sticky and drr. having issues getting integration tests running locally, but I'll figure that out and patch as needed.

@emilevauge
Copy link
Member

Thanks @bakins 👍
@errm @dtomcej WDYT of setting these annotations on services instead ?

@dtomcej
Copy link
Contributor

dtomcej commented Jan 25, 2017

@emilevauge @bakins Kubernetes load balancer settings are officially set using service annotations. I think that using the same process for traefik would be beneficial :)

👍

@emilevauge emilevauge force-pushed the kubernetes-loadbalancer-annotations branch from 6ef3b4c to 3bd9792 Compare January 26, 2017 14:01
Copy link
Member

@emilevauge emilevauge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Thanks @bakins
/cc @containous/traefik

Copy link
Contributor

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🦁

@errm errm force-pushed the kubernetes-loadbalancer-annotations branch from c3484e9 to 490427f Compare February 2, 2017 14:04
@errm
Copy link
Contributor

errm commented Feb 2, 2017

Rebased on master

Copy link
Contributor

@errm errm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@emilevauge emilevauge merged commit a70c6f2 into traefik:master Feb 2, 2017
@bakins bakins deleted the kubernetes-loadbalancer-annotations branch February 2, 2017 15:33
@ldez ldez added kind/enhancement a new or improved feature. and removed status/1-needs-design-review labels Apr 29, 2017
@hoeghh
Copy link

hoeghh commented May 16, 2017

Will i be able to see any indication on the dashboard that a service is sticky? I have added the annotation, but nothing changes in the UI. Is it documented ?

@ldez
Copy link
Contributor

ldez commented May 16, 2017

@hoeghh Currently the dashboard doesn't display the sticky state.

You can call http://<your traefik url>/api/providers to get the full configuration.
ex: http://127.0.0.1:8080/api/providers

@hoeghh
Copy link

hoeghh commented May 17, 2017

@ldez thanks, it works.

@dtomcej But not until i found out that the annotation should be on the service object, and not the ingress object. That just does not make any sense. Why would the annotation be on the service object? I get that not all Kubernetes variants have ingress (OpenShift) but still. The ingress object is there to tell the ingress controller how to act. The service is mostly used inside the cluster for endpoint lookups.

@dtomcej
Copy link
Contributor

dtomcej commented May 17, 2017

@hoeghh The reason the annotation is on the service is due to the ServiceType: LoadBalancer that most cloud providers implement to provide a software load balancer to the cluster. This is used instead of ingress, for instance, in AWS, will provision a new ELB. That is why those annotations are officially on the service. :)

@bakins
Copy link
Contributor Author

bakins commented May 17, 2017

@hoeghh An ingress can reference several services and a service can be in more than one ingress. One may need to set sticky, circuit breaker, or other options on a per service basis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement a new or improved feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants