Skip to content

Conversation

lordcheng10
Copy link

Description

Expand the traffic-split plug-in to solve the following scenarios:

  1. Service A is deployed in two regions, and the region-aware configuration of Eureka is enabled;
  2. Use the traffic-split plug-in to split the traffic of the service in different regions;

configuration modification

eureka-fileter: host: - https://xxx prefix: /eureka/ fetch_interval: 15 weight: 100 timeout: connect: 2000 send: 2000 read: 5000

Use the command as follows:

`
curl http://127.0.0.1:9180/apisix/admin/upstreams/zone1_provider -H "X-API-KEY: dd" -X PUT -d '{
"type": "roundrobin",
"name": "gcp_provider",
"discovery_type": "eureka-filter",
"service_name": "SERVICE-PROVIDER",
"discovery_args": {
"zone": "zone1"
}
}'

curl -i http://127.0.0.1:9180/apisix/admin/upstreams/zone2_provider -H "X-API-KEY: dd" -X PUT -d '{
"type": "roundrobin",
"name": "aws_provider",
"discovery_type": "eureka-filter",
"service_name": "SERVICE-PROVIDER",
"discovery_args": {
"zone": "zone2"
}
}'

curl -i http://127.0.0.1:9180/apisix/admin/routes/zone_traffic_split_test -H "X-API-KEY: dd" -X PUT -d '
{
"uri": "/hello",
"plugins": {
"traffic-split": {
"rules": [
{
"weighted_upstreams": [
{
"upstream_id": "zone1_provider",
"weight": 90
},
{
"upstream_id": "zone2_provider",
"weight": 10
}
]
}
]
}
}
}'
`

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. enhancement New feature or request labels May 24, 2025
@lordcheng10
Copy link
Author

@membphis @nic-6443 @nic-chen PTL,thanks!

Copy link
Contributor

@shreemaan-abhishek shreemaan-abhishek left a comment

Choose a reason for hiding this comment

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

two things:

  • advisable to discuss the proposal first with the community
  • need to add docs and test cases after ⬆️

@Baoyuantop
Copy link
Contributor

I'll convert this PR to draft first, if the changes are done please request review again.

@Baoyuantop Baoyuantop marked this pull request as draft June 16, 2025 06:59
@Baoyuantop Baoyuantop added the wait for update wait for the author's response in this issue/PR label Jul 3, 2025
Copy link

github-actions bot commented Sep 1, 2025

This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 4 weeks if no further activity occurs. If you think that's incorrect or this pull request should instead be reviewed, please simply write any comment. Even if closed, you can still revive the PR at any time or discuss it on the [email protected] list. Thank you for your contributions.

@github-actions github-actions bot added the stale label Sep 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size:M This PR changes 30-99 lines, ignoring generated files. stale wait for update wait for the author's response in this issue/PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants