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/07/19 02:37:58 UTC

[GitHub] [apisix] ly123-liu opened a new issue #4622: apisixroute 不支持多ns隔离

ly123-liu opened a new issue #4622:
URL: https://github.com/apache/apisix/issues/4622


   版本情况:
   * apisix version:2.6
   * etcd version: 3.5
   * apisix-dashboard version: 2.7
   
   背景:我们在一个k8s集群内部存在多个ns,我们希望每个ns调用各自ns里的服务(ns隔离流量),在测试apisixroute 发现,通过apisixroute增加的配置,默认会加在所有ns下的apisix中
   
   如下图,在prod-test ns下增加apisixroute:  prod-test-ingress-clearonline-apisix-route , 在tp-perf ns 增加apisixroute: tp-perf-ingress-trade-apisix-route
   ![image](https://user-images.githubusercontent.com/57338370/126094583-5f1910b9-de09-45ab-92c7-2da847410961.png)
   
   etcd中在prod-test 及tp-perf 可以看到两条路由均存在,如下图信息
   1)tp-perf ns
   /apisix/tp-perf/routes/56ab3ba1
   {"upstream_id":"4151458","plugins":{"proxy-rewrite":{"scheme":"http","regex_uri":["^\/clearonline\/v1\/(.*)","\/clearonline\/$1"]}},"name":"prod-test_prod-test-ingress-clearonline-apisix-route_rule1","uris":["\/clearonline\/v1\/*"],"id":"56ab3ba1","labels":{"managed-by":"apisix-ingress-controller"},"create_time":1626661747,"priority":0,"update_time":1626661747,"desc":"Created by apisix-ingress-controller, DO NOT modify it manually","status":1}
   /apisix/tp-perf/routes/5e88004f
   {"upstream_id":"a73e1061","plugins":{"proxy-rewrite":{"scheme":"http","regex_uri":["^\/trade\/v1\/(.*)","\/trade\/$1"]}},"name":"tp-perf_tp-perf-ingress-trade-apisix-route_rule1","uris":["\/trade\/v1\/*"],"id":"5e88004f","labels":{"managed-by":"apisix-ingress-controller"},"create_time":1626661747,"priority":0,"update_time":1626661747,"desc":"Created by apisix-ingress-controller, DO NOT modify it manually","status":1}
   /apisix/tp-perf/upstreams/4151458
   {"type":"roundrobin","hash_on":"vars","name":"prod-test_clearonline_8080","update_time":1626661747,"pass_host":"pass","labels":{"managed-by":"apisix-ingress-controller"},"create_time":1626661747,"nodes":[{"port":8080,"host":"172.28.0.204","priority":0,"weight":100}],"scheme":"http","desc":"Created by apisix-ingress-controller, DO NOT modify it manually","id":"4151458"}
   /apisix/tp-perf/upstreams/a73e1061
   {"type":"roundrobin","hash_on":"vars","name":"tp-perf_trade_8080","update_time":1626661747,"pass_host":"pass","labels":{"managed-by":"apisix-ingress-controller"},"create_time":1626661747,"nodes":[{"port":8080,"host":"172.28.1.93","priority":0,"weight":100}],"scheme":"http","desc":"Created by apisix-ingress-controller, DO NOT modify it manually","id":"a73e1061"}
   
   
   2)prod-test ns
   {"priority":0,"status":1,"uris":["\/clearonline\/v1\/*"],"update_time":1626661747,"name":"prod-test_prod-test-ingress-clearonline-apisix-route_rule1","create_time":1626661747,"desc":"Created by apisix-ingress-controller, DO NOT modify it manually","upstream_id":"4151458","plugins":{"proxy-rewrite":{"regex_uri":["^\/clearonline\/v1\/(.*)","\/clearonline\/$1"],"scheme":"http"}},"labels":{"managed-by":"apisix-ingress-controller"},"id":"56ab3ba1"}
   /apisix/prod-test/routes/5e88004f
   {"priority":0,"status":1,"uris":["\/trade\/v1\/*"],"update_time":1626661747,"name":"tp-perf_tp-perf-ingress-trade-apisix-route_rule1","create_time":1626661747,"desc":"Created by apisix-ingress-controller, DO NOT modify it manually","upstream_id":"a73e1061","plugins":{"proxy-rewrite":{"regex_uri":["^\/trade\/v1\/(.*)","\/trade\/$1"],"scheme":"http"}},"labels":{"managed-by":"apisix-ingress-controller"},"id":"5e88004f"}
   /apisix/prod-test/services/
   
   /apisix/prod-test/upstreams/4151458
   {"nodes":[{"weight":100,"priority":0,"port":8080,"host":"172.28.0.204"}],"hash_on":"vars","scheme":"http","update_time":1626661747,"type":"roundrobin","name":"prod-test_clearonline_8080","create_time":1626661747,"desc":"Created by apisix-ingress-controller, DO NOT modify it manually","pass_host":"pass","labels":{"managed-by":"apisix-ingress-controller"},"id":"4151458"}
   /apisix/prod-test/upstreams/a73e1061
   {"nodes":[{"weight":100,"priority":0,"port":8080,"host":"172.28.1.93"}],"hash_on":"vars","scheme":"http","update_time":1626661747,"type":"roundrobin","name":"tp-perf_trade_8080","create_time":1626661747,"desc":"Created by apisix-ingress-controller, DO NOT modify it manually","pass_host":"pass","labels":{"managed-by":"apisix-ingress-controller"},"id":"a73e1061"}
   
   
   在查看apisixroute源码看上去是不支持类似ingress controller 的ingress_class 类型?
   但是我是用ingress类型,通过配置kubernetes.io/ingress_class: "xxxx" 是可以实现prod-test ns只获取属于对应ingress class的ingress资源的,但是apisixroute 不支持,请问可以支持吗?
   


-- 
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: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] gxthrj commented on issue #4622: apisixroute 不支持多ns隔离

Posted by GitBox <gi...@apache.org>.
gxthrj commented on issue #4622:
URL: https://github.com/apache/apisix/issues/4622#issuecomment-882217495


   If you need to isolate and independently manage APISIX clusters according to the namespace, you can deploy multiple ingress controllers to modify the `kubernetes.app_namespaces` configuration so that each controller only cares about the specified namespace.
   ref: https://github.com/apache/apisix-ingress-controller/blob/master/conf/config-default.yaml#L41  
   
   About `ingressClass`, we are preparing to support it, welcome to discuss.
   Related issue: https://github.com/apache/apisix-ingress-controller/issues/592


-- 
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: notifications-unsubscribe@apisix.apache.org

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