pioneer-hash commented on issue #399:
URL: 
https://github.com/apache/apisix-ingress-controller/issues/399#issuecomment-824573063


   > @pioneer-hash Why we don't support cross namespace reference is because 
crossing namespace might be the main course of privilege escalation attacks. 
See 
[kubernetes/kubernetes#17088](https://github.com/kubernetes/kubernetes/issues/17088).
   > 
   > For your case, you can still put them into one YAML file.
   > 
   > ```yaml
   > apiVersion: apisix.apache.org/v2alpha1
   > kind: ApisixRoute
   > metadata:
   >  name: test-cookie
   >  namespace: gray-namespace
   > spec:
   >  http:
   >  - name: rule1
   >    priority: 1
   >    match:
   >      paths:
   >        - /*
   >    backends:
   >      - serviceName: web3
   >        servicePort: 81
   >        weight: 70
   >      - serviceName: web2
   >        servicePort: 81
   >        weight: 30
   > ---
   > apiVersion: apisix.apache.org/v2alpha1
   > kind: ApisixRoute
   > metadata:
   >  name: test-cookie-111
   >  namespace:  prod-namespace
   > spec:
   >  http:
   >   - name: rule2
   >    priority: 0
   >    match:
   >      paths:
   >        - /*
   >      exprs:
   >      - subject:
   >          scope: Cookie
   >          name: name
   >        op: Equal
   >        value: zhangsan
   >      - subject:
   >          scope: Header
   >          name: name
   >        op: NotEqual
   >        value: lisi
   >    backend:
   >      serviceName: web2
   >      servicePort: 81
   > ```
   
   Thanks for your answer


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