slime-io / slime

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

istio proxy的log出现waring,首次访问流量没有去gs,一直走PassthroughCluster #406

Closed plusices closed 1 year ago

plusices commented 1 year ago

问题描述

影响的子模块(在下面列表中打'X')

重现问题的步骤

1、安装v0.8.0的slime之后,istio proxy的logs有一堆warning日志,貌似是说envoyfilter那里不支持ENVIRONMENT(POD_NAMESPACE)的写法,我的istio版本是1.15.7;

2023-07-20T07:57:22.096419Z warning envoy config gRPC config for type.googleapis.com/envoy.config.route.v3.RouteConfiguration rejected: field 'ENVIRONMENT(POD_NAMESPACE)' not supported as custom header

2、在任意pod上面访问mesh内的service,发现首次访问流量并没有去gs,一直都走PassthroughCluster:

istio-proxy logs:

[2023-07-20T08:15:40.138Z] "GET / HTTP/1.1" 404 - via_upstream - "-" 0 0 11 11 "-" "curl/7.83.1" "760b06d1-5374-4ac7-bdad-800cda5f0b07" "reviews.default:9080" "10.0.232.90:9080" PassthroughCluster 10.240.1.212:60576 10.0.232.90:9080 10.240.1.212:46346 - allow_any

MouceL commented 1 year ago

版本不支持

你可以在slimeboot中增加以下配置,使用lua方式获取ns信息

addEnvHeaderViaLua: true

  module:
    - name: lazyload
      kind: lazyload
      enable: true
      general:
        addEnvHeaderViaLua: true
        autoPort: true
        autoFence: true
        defaultFence: true   
plusices commented 1 year ago
addEnvHeaderViaLua: true

卸载了重新安装一遍,确实可以了,文档那块最好能说明一下,谢谢~~