Commit graph

10 commits

Author SHA1 Message Date
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
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
41c925f390 bugfix: set canary attributes when initializing balancer 2018-11-13 15:44:57 +04: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
Elvin Efendi
4b07e73e5d refactor lua balancer and fix ipv6 issue 2018-08-16 13:03:41 -04:00
Elvin Efendi
cb4755835e refactor some lua code 2018-06-19 12:46:49 +04:00
Elvin Efendi
e9dc275b81 refactor balancer into more testable and extensible interface 2018-05-28 15:51:58 -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