Commit graph

60 commits

Author SHA1 Message Date
Matthias Neugebauer
26fe69cb47
Add annotation for setting sticky cookie domain (#9088)
This adds the new annotation `nginx.ingress.kubernetes.io/session-cookie-domain`
for setting the cookie `Domain` attribute of the sticky cookie.

Signed-off-by: Matthias Neugebauer <mtneug@mailbox.org>

Signed-off-by: Matthias Neugebauer <mtneug@mailbox.org>
2022-09-28 07:28:37 -07:00
Wei Wu
e625c2507a
Fix chashsubset backend with canary (#7235)
* Fix chashsubset backend with canary

* use floor for buckets calculation to remove hot spot

* Remove testing code
2021-12-29 16:14:50 -08:00
Vincent LE GOFF
f2e743f561
feat: add session-cookie-secure annotation (#7399) 2021-09-01 15:23:40 -07:00
wasker
f222c752be
Enable session affinity for canaries (#7371) 2021-07-29 14:23:19 -07:00
spacewander
06b200fa4b Update for review 2020-12-24 09:07:12 +08:00
spacewander
e118ebc08a Don't pick tried endpoint & count the latest in ewma balancer
fixes https://github.com/kubernetes/ingress-nginx/issues/6632
2020-12-18 19:21:51 +08:00
qianyong
8ca5450e22 bugfix: always update trafficShapingPolicy when using ewma as load-balance even if endpoints not change, otherwise update trafficShapingPolicy will not working 2020-12-01 12:10:15 +08:00
agile6v
bafbd4cccf Enable lj-releng tool to lint lua code. 2020-06-09 18:01:35 +08:00
agile6v
c035a144f8 Support the combination of nginx variables and text value for annotation upstream-hash-by. 2020-06-01 06:37:41 +08:00
BrianKopp
34b194c770 Update documentation and remove hack fixed by upstream cookie library 2020-02-08 11:54:52 -07:00
Brian Kopp
1b523390bb Add SameSite=None support and conditionally omit SameSite=None for backwards compatibility 2020-01-29 14:30:00 -07:00
Manuel Alejandro de Brito Fontes
6c92c80073 Fix sticky session for ingress without host 2020-01-02 16:52:49 -03:00
Alexander Maret-Huskinson
c26ab315b8 Fixed LUA lint findings. 2019-09-24 10:56:11 +02:00
Alexander Maret-Huskinson
f1839ddb42 Fixed review findings. 2019-09-24 10:46:02 +02:00
Alexander Maret-Huskinson
880b3dc5f1 Fixed test findings. 2019-08-30 19:08:03 +02:00
Alexander Maret-Huskinson
881e352d68 Converted sticky session balancers into separate classes. 2019-08-30 18:07:24 +02:00
Alexander Maret-Huskinson
9170591185 Added new affinity mode for maximum session stickyness. Fixes kubernetes/ingress-nginx#4475 2019-08-30 11:40:29 +02:00
Zovin Khanmohammed
76c2063be8
Code Review changes. Remove duplicate tests. 2019-08-26 14:00:59 -05:00
Zovin Khanmohammed
1f8ab60e40
Adds Wilcard check for hostname. Adds wildcard hostname tests. 2019-08-26 14:00:44 -05:00
Elvin Efendi
30b64df10a ewma improvements 2019-08-15 13:13:43 -04:00
Elvin Efendi
97d3a0ddab fix lua lints 2019-07-08 13:51:24 -04:00
Elvin Efendi
27df697dde introduce ngx.var.balancer_ewma_score 2019-07-03 16:50:22 -04:00
Elvin Efendi
e2c6202324 bugfix: check all previously failing upstreams, not just the last one 2019-06-07 10:00:31 -04:00
Elvin Efendi
b9b1ffb1d5 simplify sticky balancer 2019-06-06 16:32:33 -04:00
Elvin Efendi
83f2acbe38 Session Affinity ChangeOnFailure should be boolean 2019-06-06 11:22:05 -04:00
Eugene Fedunin
254629cf16 Added support for annotation session-cookie-change-on-failure
1. Session cookie is updated on previous attempt failure when `session-cookie-change-on-failure = true` (default value is `false`).
2. Added tests to check both cases.
3. Updated docs.

Co-Authored-By: Vladimir Grishin <yadolov@users.noreply.github.com>
2019-05-27 13:00:07 +03:00
Elvin Efendi
dc7fa885a2 log info when endpoints change for a balancer 2019-05-25 23:50:18 -04:00
Alex Kursell
d3ac73be79 Remove session-cookie-hash annotation 2019-03-04 10:34:48 -05:00
Alex Kursell
c180a0998b Fix session-cookie-* annotation reloading 2019-02-19 17:27:08 -05:00
Kubernetes Prow Robot
1db9c91af4
Merge pull request #3363 from skeeey/master
Document for cookie expires annotation
2019-01-14 07:52:28 -08:00
Maximilian Gaß
39dd0c50da Remove stickyness cookie domain from Lua balancer to match old behavior (#3648) 2019-01-11 22:24:45 -03:00
liuwei
7aa5834948 add cookie expires document and fix a flaw for session-cookie-expires 2019-01-11 15:35:39 +08:00
Diego Woitasen
60b983503b Consistent hashing to a subset of nodes. It works like consistent hash,
but instead of mapping to a single node, we map to a subset of nodes.
2019-01-03 01:32:52 -03:00
Fabian Topfstedt
1e31767b51 [1759] Ingress affinity session cookie with Secure flag for HTTPS
Signed-off-by: Fabian Topfstedt <topfstedt@schneevonmorgen.com>
2018-12-04 10:51:52 +01:00
Elvin Efendi
f81f06151d store ewma stats per backend 2018-11-26 16:59:26 +04:00
Zenara Daley
2b109b360b Only set cookies on paths that enable session affinity 2018-11-19 11:42:12 -05:00
k8s-ci-robot
82721e575d
Merge pull request #3372 from Shopify/session-cookie-path
Add annotation for session affinity path
2018-11-19 07:25:32 -08:00
Zenara Daley
50b29feb4a Add annotation for session affinity path 2018-11-19 09:15:24 -05:00
Elvin Efendi
41c925f390 bugfix: set canary attributes when initializing balancer 2018-11-13 15:44:57 +04:00
k8s-ci-robot
17cad51e47
Merge pull request #3341 from Shopify/canary_upstream
Add canary annotation and alternative backends for traffic shaping
2018-11-06 12:22:16 -08:00
Conor Landry
412cd70d3a implement canary annotation and alternative backends
Adds the ability to create alternative backends. Alternative backends enable
traffic shaping by sharing a single location but routing to different
backends depending on the TrafficShapingPolicy defined by AlternativeBackends.

When the list of upstreams and servers are retrieved, we then call
mergeAlternativeBackends which iterates through the paths of every ingress
and checks if the backend supporting the path is a AlternativeBackend. If
so, we then iterate through the map of servers and find the real backend
that the AlternativeBackend should fall under. Once found, the
AlternativeBackend is embedded in the list of VirtualBackends for the real
backend.

If no matching real backend for a AlternativeBackend is found, then the
AlternativeBackend is deleted as it cannot be backed by any server.
2018-11-06 13:13:14 -05:00
liuwei
3477df4c12 pass static-check 2018-11-02 17:17:29 +08:00
liuwei
c74e59fa4c Use second as cookie expires unit 2018-11-02 17:05:38 +08:00
liuwei
ce6e564f82 merge from master 2018-11-02 13:13:24 +08:00
Elvin Efendi
9e639f9788 fix sticky session implementation 2018-10-30 16:23:08 +04:00
liuwei
38279366a5 add e2e test for cookie annotations 2018-10-30 19:27:21 +08:00
liuwei
7de718f359 pass code static-check 2018-10-29 15:39:43 +08:00
liuwei
ad57c76b73 Support cookie expires 2018-10-29 15:21:10 +08:00
Henry Tran
3cbfd63992 Refactor EWMA to not use shared dictionaries 2018-10-25 22:33:42 +04:00
Hui Chen
3dc21ead49 do not hardcode the path 2018-09-17 10:52:21 +08:00