tokers commented on issue #289:
URL: 
https://github.com/apache/apisix-ingress-controller/issues/289#issuecomment-801558097


   > The `weight` configuration of the `match` part is confusing.
   > It seems that after being matched by `match`, people can continue to 
control the traffic through `weight`. So the `backend` with `match` should be 
`backends`.
   > 
   > Another point is about the default backend.
   > The default backends can be multiple, so that `weight` is meaningful.
   > 
   > BTW, there is a typo `sweight` in default backends , should be `weight`.
   
   I changed my mind, the canary release can be implemented by multiple rules 
in `spec.http`, for instance:
   
   ```yaml
   apiVersion: apisix.apache.org/v2alpha1
   kind: ApisixRoute
   metadata:
     name: httpbin-route
   spec:
     http:
     - name: rule1
       match:
         hosts:
         - httpbin.com
         paths:
         - /ip
       backend:
         serviceName: httpbin
         servicePort: 80
     - name: rule2
        match:
          hosts:
          - httpbin.com
          paths:
          - /ip
          nginxVars:
            subject: http_user_agent
            op: Equal
            value: Mozilla
        backend:
           serviceName: httpbin-2
           servicePort: 80
   ```
   
   If people want to implement the traffic shifting by weighted backends, they 
can do like this:
   
   ```yaml
   apiVersion: apisix.apache.org/v2alpha1
   kind: ApisixRoute
   metadata:
     name: httpbin-route
   spec:
     http:
     - name: rule1
        match:
          hosts:
          - httpbin.com
          paths:
          - /status
        backends:
        - serviceName: httpbin
           servicePort: 80
           weight: 100
        - serviceName: httpbin2
           servicePort: 8080
           weight: 50
   ```


----------------------------------------------------------------
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:
[email protected]


Reply via email to