Commit graph

49 commits

Author SHA1 Message Date
Kir Shatrov
0f5bf530ae
Add missing space to error message (#9069) 2022-09-20 04:03:21 -07:00
ZxYuan
362c97bd09
Remove force sync / 30s for non-external backends (#7958) 2021-12-23 12:08:30 -08:00
Yecheng Fu
5cff197bc5
add canary-weight-total annotation (#6338) 2021-12-07 08:40:00 -08:00
wasker
f222c752be
Enable session affinity for canaries (#7371) 2021-07-29 14:23:19 -07:00
Ricardo Pchevuzinske Katz
0dceedfad7 Remove localhost calls from external names
Signed-off-by: Ricardo Pchevuzinske Katz <ricardo.katz@gmail.com>
2021-04-30 16:49:35 -03:00
Kubernetes Prow Robot
7732aec3c4
Merge pull request #6600 from nic-6443/backend-sync-503-fix
Bugfix: some requests fail with 503 when nginx reload
2020-12-23 09:02:26 -08:00
qianyong
8085304cb9 Separate the ExternalName backend from other backends in the process of synchronizing the backend, because the synchronization of the ExternalName backend requires dns resolution, so we should ensure that it does not affect the synchronization of the Non-ExternalName backend. After separation, in the init worker stage, we should immediately synchronize the Non-ExternalName backend, otherwise there will be some requests that fail with 503 because the balancer cannot be obtained in the rewrite stage. 2020-12-22 17:24:41 +08:00
Josh Soref
a8728f3d2c Spelling 2020-12-15 16:10:48 -05:00
Frank Gadban
e9059eef01 fixed some typos
Signed-off-by: Frank Gadban <frankgad@outlook.de>
2020-07-21 22:02:23 +02:00
Manuel Alejandro de Brito Fontes
bcc3cfaa65 Dynamic LB sync non-external backends only when necessary 2020-06-29 18:11:51 -04:00
agile6v
bafbd4cccf Enable lj-releng tool to lint lua code. 2020-06-09 18:01:35 +08:00
Elvin Efendi
3b217cf766 make sure first backend sync happens in timer phase 2020-04-30 19:44:24 -04:00
Manuel Alejandro de Brito Fontes
1894579455 Remove unnecessary logs 2020-03-22 17:09:39 -03:00
Lisheng Zheng
0b33650bb8 Feat: canary supports using specific match strategy to match header value. 2020-02-21 10:02:20 +08:00
Yuansheng
e4571fdeef optimize: local cache global variable and reduce string object creation.
and some code style.
2019-09-25 09:43:11 -04:00
Alexander Maret-Huskinson
881e352d68 Converted sticky session balancers into separate classes. 2019-08-30 18:07:24 +02:00
Elvin Efendi
7b4655bb39 teach lua about search and ndots settings in resolv.conf 2019-08-14 18:03:30 -04:00
Elvin Efendi
8f5fa78e1a regression test 2019-07-26 10:18:31 -04:00
Elvin Efendi
6f7b66fc7d memoize balancer for a request 2019-07-26 09:35:58 -04:00
Elvin Efendi
8b208cac93 introduce proxy_alternative_upstream_name Nginx var to differentiate canary requests 2019-07-04 19:43:20 -04:00
s-shirayama
7a15f52cf1 Add unit test case for balancer.route_to_alternative_balancer() 2019-06-11 22:34:05 +09:00
Tim Reddehase
018a1e4d94 respond with 503 when there are no endpoints
* related to:
  * https://github.com/kubernetes/ingress-nginx/issues/3070
  * https://github.com/kubernetes/ingress-nginx/issues/3335
* add a 503 test
  * test a service that starts out empty
    (a.k.a. ingress-nginx controller (re-)start)
  * test scaling up (should route traffic accordingly)
  * test scaling down to empty service
  * use custom deployments for scaling test.
* provide a fix by updating the lua table (cache) of the configured backends
  to unset the backend if there are no endpoints available.
2019-02-03 11:43:47 +01:00
minherz
57440c9464 fix issue with failing e2e tests 2019-02-01 22:11:09 +02:00
minherz
de2a1ece6d add header-value annotation
add new annotation (header-value)
parse it and propogate to lua script
alter balancer rule to include it into the canary routing logic
add e2e test to validate fallback for canary-by-header-value
add description of canary-by-header-value to documentation
2019-01-30 23:23:44 +02:00
WenMing
1d37e83a18 used cjson.safe instead of pcall. 2019-01-18 23:12:22 +08:00
Elvin Efendi
ba7b542d78 canary by cookie should support hypen in cookie name 2019-01-08 13:15:02 -05: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
Elvin Efendi
764740a09a be more defensive when deciding alternative balancer 2018-11-13 16:03:26 +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
Manuel Alejandro de Brito Fontes
3838145a8c
Remove reloads when there is no endpoints 2018-11-06 09:26:04 -03:00
Elvin Efendi
589069d566 wrap IPv6 addresses into square brackets 2018-08-16 14:12:10 -04:00
Elvin Efendi
4b07e73e5d refactor lua balancer and fix ipv6 issue 2018-08-16 13:03:41 -04:00
Elvin Efendi
d4faf68416 add support for ExternalName service type in dynamic mode 2018-07-25 09:05:47 -04:00
Elvin Efendi
b4e6513fc8 make sure after_balance is actually otional
add inline comment to make LB algorithm change detection logic clearer

also require port in addition to host
2018-05-28 16:08:53 -04:00
Elvin Efendi
da3a87646a make sure balancer gets deleted when ther is no backend 2018-05-28 15:51:58 -04:00
Elvin Efendi
e9dc275b81 refactor balancer into more testable and extensible interface 2018-05-28 15:51:58 -04:00
Elvin Efendi
7ac4e1db30 fix bug with lua sticky session implementation and refactor balancer 2018-05-16 21:00:39 -04:00
Elvin Efendi
44ddd8abba force backend sync when worker starts 2018-05-14 17:08:23 -04:00
Elvin Efendi
992a68de23 upstream-hash-by should override load-balance annotation 2018-05-10 13:47:19 -04:00
Elvin Efendi
6cb28e059c use roundrobin from lua-resty-balancer library and refactor balancer.lua 2018-05-10 13:47:19 -04:00
Elvin Efendi
2ce9196ecf upstream-hash-by annotation support for dynamic configuraton mode 2018-04-27 14:28:43 -04:00
Zenara Daley
0d0d33aec9 add balancer unit tests 2018-04-24 12:10:57 -04:00
Zenara Daley
6ed256dde6 Add session affinity to custom load balancing 2018-04-12 14:21:42 -04:00
Elvin Efendi
a6fe800a47 lua-resty-waf controller (#2304) 2018-04-08 17:37:13 -03:00
Elvin Efendi
931e541fb7 Fix bug when auth req is enabled(external authentication) (#2280)
* set proxy_upstream_name correctly when auth_req module is used

* log a more meaningful message when backend is not found
2018-03-30 14:19:33 -03:00
Zenara Daley
6e099c5f57 Add EWMA as configurable load balancing algorithm (#2229) 2018-03-23 12:06:21 -03:00
halfcrazy
977cfcb4c7 add luacheck to lint lua files (#2205) 2018-03-18 13:31:49 -03:00
Elvin Efendi
c90a4e811e Live Nginx (re)configuration without reloading (#2174) 2018-03-18 10:13:41 -03:00