jizhuozhi commented on issue #12487:
URL: https://github.com/apache/apisix/issues/12487#issuecomment-3160681306
Hi @SkyeYoung , I'm sorry for replying you so late.
## Abourt how to config
There are two ways to configure the plugin, the first one is envoy style, as
an extension configure of current loadbalancers
```yaml
type: roundrobin
subset:
fallback_policy: DEFAULT_SUBSET
default_subset:
stage: prod
subset_selectors:
- keys:
- v
- stage
- keys:
- stage
fallback_policy: NO_FALLBACK
```
the second one is making subset as a new loadbalancer and configuring actual
loadbalancer policy
```yaml
type: subset
subset:
type: roundrobin
fallback_policy: DEFAULT_SUBSET
default_subset:
stage: prod
subset_selectors:
- keys:
- v
- stage
- keys:
- stage
fallback_policy: NO_FALLBACK
```
## How to develop plugin
Each subset selector can be thought of as a typical Trie based on its keys.
Therefore, we actually maintain a list of Trie, with each leaf node
representing all nodes that satisfy the subset. These nodes are then used to
build a load balancer.
When receiving a request, the keys are first matched against the request
header (a configurable prefix). If a matching subset is found, the
corresponding loadbalancer is used to select an node. If no node matches any of
the subsets, the fallback strategy determines the node selection.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]