slime-io / slime

An intelligent ServiceMesh manager based on Istio
https://slime-io.github.io/
Other
426 stars 78 forks source link

global.outboundTrafficPolicy.mode 设置为 REGISTRY_ONLY 时,block_all路由和to_global_sidecar路由冲突 #362

Open hexiaodai opened 1 year ago

hexiaodai commented 1 year ago

Bug description

Affected sub-moudle (please put an X in all that apply)

[X ] Configuration Lazy Loading [ ] Http Plugin Management [ ] Adaptive Ratelimit [ ] Slime Boot

Steps to reproduce the bug

  1. istioctl install --set meshConfig.outboundTrafficPolicy.mode=REGISTRY_ONLY
  2. kubectl logs sleep-xxx -c istio-proxy rejected: Only a single wildcard domain is permitted in route 9080

block_all 路由和 to_global_sidecar 路由冲突

        "virtualHosts": [
            {
                "name": "block_all",
                "domains": [
                    "*"
                ],
                "routes": [
                    {
                        "name": "block_all",
                        "match": {
                            "prefix": "/"
                        },
                        "directResponse": {
                            "status": 502
                        }
                    }
                ],
                "includeRequestAttemptCount": true
            },
        ...
    ]
hexiaodai commented 1 year ago

https://istio.io/latest/blog/2019/monitoring-external-service-traffic/

YonkaFang commented 1 year ago

这个是已知场景,只是没想到就遇到了。

这么说需要把outboundTrafficPolicy传递给slime,从而决定该行为: 是替换allow_any还是block_all。