lordcheng10 opened a new pull request, #12250:
URL: https://github.com/apache/apisix/pull/12250

   ### 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
               }
             ]
           }
         ]
       }
     }
   }'
   `
   
   
   


-- 
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]

Reply via email to