slime-io / slime

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

兜底路由在1.11 istio 不生效 #357

Closed MouceL closed 1 year ago

MouceL commented 1 year ago

Bug description

slime v0.7.0支持ip:port格式域名透传功能,使用了istio 1.11还不支持的 string_match

导致下发至envoy后配置的缺失,导致所有格式的的域名都被透传了,懒加载无法生效。

           - domains:
              - '*'
              name: to_global_sidecar
              routes:
                - match:
                    prefix: /
                    headers:
                    - name: ':authority'
                      string_match:
                        safe_regex:
                          google_re2: {}
                          regex: '^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(?::([1-9]|[1-9]\d{1,3}|[1-5]\d{4}|6[0-5][0-5][0-3][0-5]))?$'
                  route:
                    cluster: PassthroughCluster
                    timeout: 0s
                - match:
                    prefix: /
                  route:
                    cluster: outbound|{{ $gsPort }}||global-sidecar.{{ $clusterGsNamespace }}.svc.cluster.local
                    timeout: 0s

最终导致下发的配置只有

           - domains:
              - '*'
              name: to_global_sidecar
              routes:
                - match:
                    prefix: /
                    headers:
                    - name: ':authority'
                    cluster: PassthroughCluster
                    timeout: 0s

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

MouceL commented 1 year ago

https://github.com/slime-io/slime/pull/318 中引入了 HeaderMatcher_StringMatch

可以让ip:port直接走passthrouth

但对应的istio 1.11.3不支持stringMatch,导致的后果是所有的首次访问请求都直接走passthrough

直到 go-control-plane:v0.10.0 才支持

对于这个兼容性问题,我们的将提供一个透传ip:port功能的开关,用户可显示关闭该功能,后果就是ip:port依旧被转发到global-sidecar