You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/03/21 07:41:55 UTC

[GitHub] [apisix-ingress-controller] tokers commented on a change in pull request #308: feat: traffic split

tokers commented on a change in pull request #308:
URL: https://github.com/apache/apisix-ingress-controller/pull/308#discussion_r598236940



##########
File path: docs/en/latest/concepts/apisix_route.md
##########
@@ -139,12 +139,46 @@ spec:
           - /*
         methods:
           - GET
-      backend:
-        serviceName: foo
-        servicePort: 80
-        resolveGranularity: service
+      backends:
+        - serviceName: foo
+          servicePort: 80
+          resolveGranularity: service
 ```
 
+Weight Based Traffic Split
+--------------------------
+
+There can more than one backend specified in one route rule,
+when multiple backends co-exist there, the traffic split based on weights
+will be applied (which actually uses the [traffic-split](http://apisix.apache.org/docs/apisix/plugins/traffic-split/) plugin in Apache APISIX).
+You can specify weight for each backend, the default weight is `100`.
+
+```yaml
+apiVersion: apisix.apache.org/v2alpha1
+kind: ApisixRoute
+metadata:
+  name: method-route
+spec:
+  http:
+    - name: method
+      match:
+        paths:
+          - /*
+        methods:
+          - GET
+      backends:
+        - serviceName: foo
+          servicePort: 80
+          weight: 100
+        - serviceName: bar
+          servicePort: 81
+          weight: 50
+```
+
+The above `ApisixRoute` has one route rule, which contains two backends `foo` and `bar`, the
+weight ratio is `100:50`, which means `2/3` requests will be sent to service `foo` and `1/3` requests
+will be proxied to serivce `bar`.
+

Review comment:
       OK, will added.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org