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

added an enviroment variable for balance alg. and ability to disable route cookies #11984

Merged
merged 1 commit into from
Dec 11, 2016

Conversation

JacobTanenbaum
Copy link
Contributor

@JacobTanenbaum JacobTanenbaum commented Nov 21, 2016

added ROUTER_DEFAULT_BALANCE which allows the default balance algorithm
for edge and reencrypt routes to be set for the cluster

added annotation haproxy.router.openshift.io/use_cookies which when set
to false | FALSE omits the creation of a cookie so the balance algorithm
is used to determine endpoints everytime a request is made.

docs PR will follow once the new names are agreed on

Trello card https://trello.com/c/B56OdzdS

@JacobTanenbaum
Copy link
Contributor Author

@knobunc

Copy link
Contributor

@knobunc knobunc left a comment

Choose a reason for hiding this comment

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

LGTM @openshift/networking PTAL

@knobunc
Copy link
Contributor

knobunc commented Nov 29, 2016

[test]

@knobunc
Copy link
Contributor

knobunc commented Nov 29, 2016

We need to update the docs with the new ENV and with the annotation (and make sure all annotations are documented which may also resolve https://trello.com/c/hBWtixqA/299-add-tests-and-documentation-for-ddos-router-annotations-ingress and https://trello.com/c/62X44q90/276-document-the-router-template-format-and-how-to-use-annotations-ingress)

@ramr
Copy link
Contributor

ramr commented Nov 30, 2016

The code changes look good. A couple of thoughts though.

  1. I think we should change the name to be a lil' more descriptive of what it is used for. Something like ROUTER_LOAD_BALANC{E,ING}_ALGO{,RE,RITHM} maybe?
    There's an easter egg in there btw!! ;^)

  2. haproxy.router.openshift.io/use_cookies ==> haproxy.router.openshift.io/disable_cookies
    It might be better to use an inverted form of use_cookies - disable_cookies maybe? Set it to true
    to make it so (didn't want to say enable that disabled functionality). And yeah, the false/true
    checks for that annotation would need to be inverted.
    I kind of like that as it means by default cookies are enabled unless you explicitly disable them for
    a route.

@JacobTanenbaum
Copy link
Contributor Author

Docs PR 3301

@ramr
Copy link
Contributor

ramr commented Nov 30, 2016

LGTM - tests flaked due yum/dnf cache sync.
re[test]

Copy link
Contributor

@ramr ramr left a comment

Choose a reason for hiding this comment

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

LGTM

@ramr
Copy link
Contributor

ramr commented Nov 30, 2016

@JacobTanenbaum squash the commits and this is good to go - thx

Copy link
Contributor

@pecameron pecameron left a comment

Choose a reason for hiding this comment

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

Should there be oadm router options to create the environment variable and annotation?

@@ -459,7 +465,11 @@ backend be_secure_{{$cfgIdx}}
balance {{ $balanceAlgo }}
{{ end }}
{{ else }}
{{ if (matchPattern "roundrobin|leastconn|source" (env "ROUTER_LOAD_BALANCE_ALGORITHM" "")) }}
balance {{ env "ROUTER_LOAD_BALANCE_ALGORITHM" "leastconn"}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this environment variable be added to the DC as well? It would make it easier for the user and make the doc easier as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

We don't expose everything in the oadm. They can do 'oc set env dc/router ROUTER_LOAD_BALANCE_ALGORITHM=source' if they want to change it.

We need to make sure that we document the new environment variable and annotation. And we should provide a snippet showing how to set ENV and annotations from the cli (with a link to the full docs).

@knobunc
Copy link
Contributor

knobunc commented Dec 1, 2016

Last flake was rpm pull error. re-[test]

route cookies

added ROUTER_DEFAULT_BALANCE which allows the default balance algorithm
for edge and reencrypt routes to be set for the cluster

added annotation haproxy.router.openshift.io/use_cookies which when set
to false | FALSE omits the creation of a cookie so the balance algorithm
is used to determine endpoints everytime a request is made.

changelog:
- changed the name of the annotation haproxy.router.openshift.io/use_cookies to haproxy.router.openshift.io/disable_cookies
- change env variable ROUTER_DEFAULT_LOAD_BALANCE to ROUTER_LOAD_BALANCE_ALGORITHM
@openshift-bot
Copy link
Contributor

Evaluated for origin test up to 377284f

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/11871/) (Base Commit: a38151f)

@JacobTanenbaum
Copy link
Contributor Author

@knobunc is this good to merge?

@knobunc
Copy link
Contributor

knobunc commented Dec 6, 2016

[merge]

@knobunc
Copy link
Contributor

knobunc commented Dec 7, 2016

[merge] failure was flake #11024 (logs: https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/12074/)

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to 377284f

@openshift-bot
Copy link
Contributor

openshift-bot commented Dec 11, 2016

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/11871/) (Base Commit: cb5c7e5) (Image: devenv-rhel7_5526)

@openshift-bot openshift-bot merged commit e40d2bf into openshift:master Dec 11, 2016
@smarterclayton
Copy link
Contributor

Starting since this merged, I've been seeing lots of TestRouter flakes. Can you help prove that this is not this PR?

@smarterclayton
Copy link
Contributor

failed  TestRouter
I1212 13:52:16.448562     330 router_http_server.go:303] Started, serving at 172.18.3.29:8080
I1212 13:52:16.448644     330 router_http_server.go:303] Started, serving at 172.18.3.29:8888
I1212 13:52:16.448693     330 router_http_server.go:303] Started, serving at 172.18.3.29:8889
I1212 13:52:16.449294     330 router_http_server.go:335] Started, serving TLS at 172.18.3.29:8443
I1212 13:52:49.357958     330 router_http_server.go:208] Stopping listener at 172.18.3.29:8080
I1212 13:52:49.357987     330 router_http_server.go:208] Stopping listener at 172.18.3.29:8888
I1212 13:52:49.357996     330 router_http_server.go:208] Stopping listener at 172.18.3.29:8889
I1212 13:52:49.358010     330 router_http_server.go:208] Stopping listener at 172.18.3.29:8443
--- FAIL: TestRouter (32.91s)
	router_test.go:1229: timed out attempting to send to channel: {"type":"ADDED","object":{"kind":"Endpoints","apiVersion":"v1","metadata":{"name":"example","namespace":"rotorouter","creationTimestamp":null},"subsets":[{"addresses":[{"ip":"172.18.3.29"}],"ports":[{"port":8888}]}]}}
E1212 13:52:49.358048     330 router_http_server.go:309] HTTP server failed: accept tcp 172.18.3.29:8080: use of closed network connection
E1212 13:52:49.358048     330 router_http_server.go:309] HTTP server failed: accept tcp 172.18.3.29:8888: use of closed network connection
FAIL

@knobunc
Copy link
Contributor

knobunc commented Dec 12, 2016

@JacobTanenbaum: Here's the link to the test queue:
https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin_integration/buildTimeTrend

Unfortunately this PR is the only thing that touches code in roughly the right area before the failures start.

@knobunc
Copy link
Contributor

knobunc commented Dec 13, 2016

@JacobTanenbaum you can ignore this (in case you haven't seen the discussion in #12236)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants