slime-io / slime

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

lazyload does not work, handle accesslog error #394

Closed lusains closed 1 year ago

lusains commented 1 year ago

问题描述 开启label后 业务的istio-proxy报错: image

lazyload日志也报错 image

版本信息: istio 1.14.6 kubernetes 1.18.9 slime-boot版本 v0.7.2 影响的子模块(在下面列表中打'X')

重现问题的步骤 1、部署slime-boot ,按照kubernetes版本要求安装crd 2、部署懒加载配置,手动生成sf方式 3、给业务打label,业务istio-proxy报错 4、业务出口访问报错 [2023-06-27T11:09:39.048Z] "GET /details/0 HTTP/1.1" 503 NC cluster_not_found - "-" 0 0 0 - "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" "9718e6cf-90d2-964a-85f0-2c29f969d4b2" "details:9080" "-" - - 10.101.67.227:9080 10.100.80.206:44932 - default [2023-06-27T11:09:39.050Z] "GET /reviews/0 HTTP/1.1" 503 NC cluster_not_found - "-" 0 0 0 - "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" "9718e6cf-90d2-964a-85f0-2c29f969d4b2" "reviews:9080" "-" - - 10.101.191.65:9080 10.100.80.206:56746 - default [2023-06-27T11:09:39.053Z] "GET /reviews/0 HTTP/1.1" 503 NC cluster_not_found - "-" 0 0 0 - "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" "9718e6cf-90d2-964a-85f0-2c29f969d4b2" "reviews:9080" "-" - - 10.101.191.65:9080 10.100.80.206:56754 - default [2023-06-27T11:09:39.044Z] "GET /productpage HTTP/1.1" 200 - via_upstream - "-" 0 3769 10 9 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" "9718e6cf-90d2-964a-85f0-2c29f969d4b2" "10.100.80.206:9080" "10.100.80.206:9080" inbound|9080|| 127.0.0.6:51309 10.100.80.206:9080 172.18.113.229:50835 - default

MouceL commented 1 year ago

与istio/envoy版本不兼容,https://github.com/slime-io/slime/pull/354 里提及的版本可能有误

在slimeboot中指明 addEnvHeaderViaLua: "true" 再试下

apiVersion: config.netease.com/v1alpha1
kind: SlimeBoot
metadata:
  name: lazyload
  namespace: mesh-operator
spec:
  image:
    pullPolicy: Always
    repository: docker.io/slimeio/slime-lazyload
    tag: v0.7.2
  namespace: mesh-operator
  istioNamespace: istio-system
  module:
    - name: lazyload
      kind: lazyload
      enable: true
      general:
        autoPort: true
        autoFence: true
        defaultFence: true   
        wormholePort: # replace to your application service ports, and extend the list in case of multi ports
          - "9080"
      global:
        log:
          logLevel: info
        misc:
          addEnvHeaderViaLua: "true"
          globalSidecarMode: cluster # the mode of global-sidecar
          metricSourceType: accesslog # indicate the metric source
        slimeNamespace: mesh-operator
  resources:
    requests:
      cpu: 300m
      memory: 300Mi
    limits:
      cpu: 600m
      memory: 600Mi        
  component:
    globalSidecar:
      enable: true
      sidecarInject:
        enable: true # should be true
        mode: pod
        labels: # optional, used for sidecarInject.mode = pod
          sidecar.istio.io/inject: "true"
      resources:
        requests:
          cpu: 200m
          memory: 200Mi
        limits:
          cpu: 400m
          memory: 400Mi
      image:
        repository: docker.io/slimeio/slime-global-sidecar
        tag: v0.7.2
      probePort: 20000
lusains commented 1 year ago

添加 addEnvHeaderViaLua: "true" 懒加载可以了,但是lazyload的pod报错误日志,希望可以优化。 time=2023-06-27T11:33:00Z level=error msg=UpstreamCluster is wrong: parts number is not 4, skip function=spliceDestinationSvc module=lazyload pkg=controllers reporter=accesslog convertor time=2023-06-27T11:33:00Z level=error msg=convertor [lazyload-accesslog-convertor] converted error: tmpResult is nil function=StreamAccessLogs reporter=AccessLogSource time=2023-06-27T11:33:02Z level=error msg=UpstreamCluster is wrong: parts number is not 4, skip function=spliceDestinationSvc module=lazyload pkg=controllers reporter=accesslog convertor time=2023-06-27T11:33:02Z level=error msg=convertor [lazyload-accesslog-convertor] converted error: tmpResult is nil function=StreamAccessLogs reporter=AccessLogSource time=2023-06-27T11:33:04Z level=error msg=UpstreamCluster is wrong: parts number is not 4, skip function=spliceDestinationSvc module=lazyload pkg=controllers reporter=accesslog convertor time=2023-06-27T11:33:04Z level=error msg=convertor [lazyload-accesslog-convertor] converted error: tmpResult is nil function=StreamAccessLogs reporter=AccessLogSource time=2023-06-27T11:33:06Z level=error msg=UpstreamCluster is wrong: parts number is not 4, skip function=spliceDestinationSvc module=lazyload pkg=controllers reporter=accesslog convertor time=2023-06-27T11:33:06Z level=error msg=convertor [lazyload-accesslog-convertor] converted error: tmpResult is nil function=StreamAccessLogs reporter=AccessLogSource time=2023-06-27T11:33:08Z level=error msg=UpstreamCluster is wrong: parts number is not 4, skip function=spliceDestinationSvc module=lazyload pkg=controllers reporter=accesslog convertor time=2023-06-27T11:33:08Z level=error msg=convertor [lazyload-accesslog-convertor] converted error: tmpResult is nil function=StreamAccessLogs reporter=AccessLogSource

MouceL commented 1 year ago

这个应该是个warn日志,可以优化