Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请求转换插件不生效 #1780

Closed
jingzhe6414 opened this issue Feb 19, 2025 · 5 comments
Closed

请求转换插件不生效 #1780

jingzhe6414 opened this issue Feb 19, 2025 · 5 comments

Comments

@jingzhe6414
Copy link

配置文件:

全局版本:
apiVersion: extensions.higress.io/v1alpha1 kind: WasmPlugin metadata: annotations: higress.io/wasm-plugin-description: Convert request/response headers, request query parameters, and request/response body parameters. higress.io/wasm-plugin-icon: https://img.alicdn.com/imgextra/i3/O1CN01bAFa9k1t1gdQcVTH0_!!6000000005842-2-tps-42-42.png higress.io/wasm-plugin-title: Transformer creationTimestamp: "2025-02-19T09:22:10Z" generation: 1 labels: higress.io/resource-definer: higress higress.io/wasm-plugin-built-in: "true" higress.io/wasm-plugin-category: transform higress.io/wasm-plugin-name: transformer higress.io/wasm-plugin-version: 1.0.0 name: transformer-1.0.0 namespace: higress-system resourceVersion: "37965942" uid: 631c791d-18ac-4e66-bb76-ba9e7ef8bd48 spec: defaultConfig: respRules: - body: - key: foo.bar value: value operate: add defaultConfigDisable: false failStrategy: FAIL_OPEN matchRules: [] phase: AUTHN priority: 410 url: oci://higress-registry.cn-hangzhou.cr.aliyuncs.com/plugins/transformer:1.0.0
单路由:
`apiVersion: extensions.higress.io/v1alpha1
kind: WasmPlugin
metadata:
annotations:
higress.io/wasm-plugin-description: Convert request/response headers, request
query parameters, and request/response body parameters.
higress.io/wasm-plugin-icon: https://img.alicdn.com/imgextra/i3/O1CN01bAFa9k1t1gdQcVTH0_!!6000000005842-2-tps-42-42.png
higress.io/wasm-plugin-title: Transformer
creationTimestamp: "2025-02-19T08:14:50Z"
generation: 6
labels:
higress.io/resource-definer: higress
higress.io/wasm-plugin-built-in: "true"
higress.io/wasm-plugin-category: transform
higress.io/wasm-plugin-name: transformer
higress.io/wasm-plugin-version: 1.0.0
name: transformer-1.0.0
namespace: higress-system
resourceVersion: "37953239"
uid: ddc07bf6-fe98-44a1-b4c7-c4ffc21d5d82
spec:
defaultConfigDisable: true
failStrategy: FAIL_OPEN
matchRules:

  • config:
    reqRules:
    • headers:
      • key: X-model-type
        value: image
        operate: add
        configDisable: false
        ingress:
    • stabilityai-stable-diffusion-3-medium
      phase: AUTHN
      priority: 410
      `

按照上面的配置在返回和请求的信息里都没有期望的字段。

控制台日志:

2025-02-19T08:50:30.438014Z info ads full push happen, reason:map[config:1] 2025-02-19T08:50:30.538564Z info ads Push debounce stable[124] 1 for config WasmPlugin/higress-system/transformer-1.0.0-wasmplugin: 100.339692ms since last change, 100.339395ms since last push, full=true 2025-02-19T08:50:30.539183Z info ingress resource type extensions.istio.io/v1alpha1/WasmPlugin, ingress number 7, convert configs number 7 2025-02-19T08:50:30.540989Z info ads XDS: Pushing Services:0 ConnectedEndpoints:1 Version:2025-02-19T08:50:30Z/124 2025-02-19T08:50:30.541113Z info ingress controller tracing ConstructEnvoyFilters 2025-02-19T08:50:30.541167Z info ingress controller gzip ConstructEnvoyFilters 2025-02-19T08:50:30.541174Z info ingress controller global-option ConstructEnvoyFilters 2025-02-19T08:50:30.541420Z info ingress Append 1 configmap EnvoyFilters 2025-02-19T08:50:30.541434Z info ingress resource type networking.istio.io/v1alpha3/EnvoyFilter, configs number 1 2025-02-19T08:50:30.541605Z info ads networking.istio.io/v1alpha3/EnvoyFilter: PUSH for node:higress-controller-6b59c6d776-sjp8v.higress-system resources:1 size:838B 2025-02-19T08:50:30.545567Z info ingress resource type networking.istio.io/v1alpha3/Gateway, ingress number 7, convert configs number 4 2025-02-19T08:50:30.545773Z info ads networking.istio.io/v1alpha3/Gateway: PUSH for node:higress-controller-6b59c6d776-sjp8v.higress-system resources:4 size:1.3kB 2025-02-19T08:50:30.545812Z info ads security.istio.io/v1beta1/PeerAuthentication: PUSH for node:higress-controller-6b59c6d776-sjp8v.higress-system resources:0 size:0B 2025-02-19T08:50:30.545837Z info ads security.istio.io/v1beta1/RequestAuthentication: PUSH for node:higress-controller-6b59c6d776-sjp8v.higress-system resources:0 size:0B 2025-02-19T08:50:30.546221Z info ingress Found mcp serviceEntries [0xc0003ee9a0 0xc000430930 0xc00080e000] 2025-02-19T08:50:30.546246Z info ingress resource type networking.istio.io/v1alpha3/ServiceEntry, ingress number 7, convert configs number 3 2025-02-19T08:50:30.546350Z info ads networking.istio.io/v1alpha3/ServiceEntry: PUSH for node:higress-controller-6b59c6d776-sjp8v.higress-system resources:3 size:793B 2025-02-19T08:50:30.546381Z info ads networking.istio.io/v1alpha3/WorkloadEntry: PUSH for node:higress-controller-6b59c6d776-sjp8v.higress-system resources:0 size:0B 2025-02-19T08:50:30.546762Z info ingress resource type networking.istio.io/v1alpha3/DestinationRule, ingress number 7, convert configs number 0 2025-02-19T08:50:30.546808Z info ads networking.istio.io/v1alpha3/DestinationRule: PUSH for node:higress-controller-6b59c6d776-sjp8v.higress-system resources:0 size:0B 2025-02-19T08:50:30.546833Z info ads networking.istio.io/v1alpha3/WorkloadGroup: PUSH for node:higress-controller-6b59c6d776-sjp8v.higress-system resources:0 size:0B 2025-02-19T08:50:30.546856Z info ads security.istio.io/v1beta1/AuthorizationPolicy: PUSH for node:higress-controller-6b59c6d776-sjp8v.higress-system resources:0 size:0B 2025-02-19T08:50:30.546879Z info ads networking.istio.io/v1beta1/ProxyConfig: PUSH for node:higress-controller-6b59c6d776-sjp8v.higress-system resources:0 size:0B 2025-02-19T08:50:30.546900Z info ads networking.istio.io/v1alpha3/Sidecar: PUSH for node:higress-controller-6b59c6d776-sjp8v.higress-system resources:0 size:0B 2025-02-19T08:50:30.546923Z info ads telemetry.istio.io/v1alpha1/Telemetry: PUSH for node:higress-controller-6b59c6d776-sjp8v.higress-system resources:0 size:0B 2025-02-19T08:50:30.547538Z info ingress Found 0 number of basic auth 2025-02-19T08:50:30.547555Z info ingress Found 0 number of envoyFilters 2025-02-19T08:50:30.547564Z info ingress resource type networking.istio.io/v1alpha3/VirtualService, ingress number 7, convert configs number 4 2025-02-19T08:50:30.547725Z info ads networking.istio.io/v1alpha3/VirtualService: PUSH for node:higress-controller-6b59c6d776-sjp8v.higress-system resources:4 size:2.0kB 2025-02-19T08:50:30.548029Z info ingress resource type extensions.istio.io/v1alpha1/WasmPlugin, ingress number 7, convert configs number 7 2025-02-19T08:50:30.548913Z info ads extensions.istio.io/v1alpha1/WasmPlugin: PUSH for node:higress-controller-6b59c6d776-sjp8v.higress-system resources:7 size:12.6kB

@CH3CHO
Copy link
Collaborator

CH3CHO commented Feb 19, 2025

上面配置和日志的格式能用“``` ```”来包一下吗,都乱了。。。

@jingzhe6414
Copy link
Author

上面配置和日志的格式能用“ ”来包一下吗,都乱了。。。

配置文件:

全局版本:

apiVersion: extensions.higress.io/v1alpha1
kind: WasmPlugin
metadata:
  annotations:
    higress.io/wasm-plugin-description: Convert request/response headers, request
      query parameters, and request/response body parameters.
    higress.io/wasm-plugin-icon: https://img.alicdn.com/imgextra/i3/O1CN01bAFa9k1t1gdQcVTH0_!!6000000005842-2-tps-42-42.png
    higress.io/wasm-plugin-title: Transformer
  creationTimestamp: "2025-02-19T09:22:10Z"
  generation: 1
  labels:
    higress.io/resource-definer: higress
    higress.io/wasm-plugin-built-in: "true"
    higress.io/wasm-plugin-category: transform
    higress.io/wasm-plugin-name: transformer
    higress.io/wasm-plugin-version: 1.0.0
  name: transformer-1.0.0
  namespace: higress-system
  resourceVersion: "37965942"
  uid: 631c791d-18ac-4e66-bb76-ba9e7ef8bd48
spec:
  defaultConfig:
    respRules:
    - body:
      - key: foo.bar
        value: value
      operate: add
  defaultConfigDisable: false
  failStrategy: FAIL_OPEN
  matchRules: []
  phase: AUTHN
  priority: 410
  url: oci://higress-registry.cn-hangzhou.cr.aliyuncs.com/plugins/transformer:1.0.0

单路由:

apiVersion: extensions.higress.io/v1alpha1
kind: WasmPlugin
metadata:
  annotations:
    higress.io/wasm-plugin-description: Convert request/response headers, request
      query parameters, and request/response body parameters.
    higress.io/wasm-plugin-icon: https://img.alicdn.com/imgextra/i3/O1CN01bAFa9k1t1gdQcVTH0_!!6000000005842-2-tps-42-42.png
    higress.io/wasm-plugin-title: Transformer
  creationTimestamp: "2025-02-19T08:14:50Z"
  generation: 6
  labels:
    higress.io/resource-definer: higress
    higress.io/wasm-plugin-built-in: "true"
    higress.io/wasm-plugin-category: transform
    higress.io/wasm-plugin-name: transformer
    higress.io/wasm-plugin-version: 1.0.0
  name: transformer-1.0.0
  namespace: higress-system
  resourceVersion: "37953239"
  uid: ddc07bf6-fe98-44a1-b4c7-c4ffc21d5d82
spec:
  defaultConfigDisable: true
  failStrategy: FAIL_OPEN
  matchRules:
  - config:
      reqRules:
      - headers:
        - key: X-model-type
          value: image
        operate: add
    configDisable: false
    ingress:
    - stabilityai-stable-diffusion-3-medium
  phase: AUTHN
  priority: 410
  url: oci://higress-registry.cn-hangzhou.cr.aliyuncs.com/plugins/transformer:1.0.0

日志:

2025-02-19T08:50:30.438014Z     info    ads     full push happen, reason:map[config:1]
2025-02-19T08:50:30.538564Z     info    ads     Push debounce stable[124] 1 for config WasmPlugin/higress-system/transformer-1.0.0-wasmplugin: 100.339692ms since last change, 100.339395ms since last push, full=true
2025-02-19T08:50:30.539183Z     info    ingress resource type extensions.istio.io/v1alpha1/WasmPlugin, ingress number 7, convert configs number 7
2025-02-19T08:50:30.540989Z     info    ads     XDS: Pushing Services:0 ConnectedEndpoints:1 Version:2025-02-19T08:50:30Z/124
2025-02-19T08:50:30.541113Z     info    ingress controller tracing ConstructEnvoyFilters
2025-02-19T08:50:30.541167Z     info    ingress controller gzip ConstructEnvoyFilters
2025-02-19T08:50:30.541174Z     info    ingress controller global-option ConstructEnvoyFilters
2025-02-19T08:50:30.541420Z     info    ingress Append 1 configmap EnvoyFilters
2025-02-19T08:50:30.541434Z     info    ingress resource type networking.istio.io/v1alpha3/EnvoyFilter, configs number 1
2025-02-19T08:50:30.541605Z     info    ads     networking.istio.io/v1alpha3/EnvoyFilter: PUSH for node:higress-controller-6b59c6d776-sjp8v.higress-system resources:1 size:838B
2025-02-19T08:50:30.545567Z     info    ingress resource type networking.istio.io/v1alpha3/Gateway, ingress number 7, convert configs number 4
2025-02-19T08:50:30.545773Z     info    ads     networking.istio.io/v1alpha3/Gateway: PUSH for node:higress-controller-6b59c6d776-sjp8v.higress-system resources:4 size:1.3kB
2025-02-19T08:50:30.545812Z     info    ads     security.istio.io/v1beta1/PeerAuthentication: PUSH for node:higress-controller-6b59c6d776-sjp8v.higress-system resources:0 size:0B
2025-02-19T08:50:30.545837Z     info    ads     security.istio.io/v1beta1/RequestAuthentication: PUSH for node:higress-controller-6b59c6d776-sjp8v.higress-system resources:0 size:0B
2025-02-19T08:50:30.546221Z     info    ingress Found mcp serviceEntries [0xc0003ee9a0 0xc000430930 0xc00080e000]
2025-02-19T08:50:30.546246Z     info    ingress resource type networking.istio.io/v1alpha3/ServiceEntry, ingress number 7, convert configs number 3
2025-02-19T08:50:30.546350Z     info    ads     networking.istio.io/v1alpha3/ServiceEntry: PUSH for node:higress-controller-6b59c6d776-sjp8v.higress-system resources:3 size:793B
2025-02-19T08:50:30.546381Z     info    ads     networking.istio.io/v1alpha3/WorkloadEntry: PUSH for node:higress-controller-6b59c6d776-sjp8v.higress-system resources:0 size:0B
2025-02-19T08:50:30.546762Z     info    ingress resource type networking.istio.io/v1alpha3/DestinationRule, ingress number 7, convert configs number 0
2025-02-19T08:50:30.546808Z     info    ads     networking.istio.io/v1alpha3/DestinationRule: PUSH for node:higress-controller-6b59c6d776-sjp8v.higress-system resources:0 size:0B
2025-02-19T08:50:30.546833Z     info    ads     networking.istio.io/v1alpha3/WorkloadGroup: PUSH for node:higress-controller-6b59c6d776-sjp8v.higress-system resources:0 size:0B
2025-02-19T08:50:30.546856Z     info    ads     security.istio.io/v1beta1/AuthorizationPolicy: PUSH for node:higress-controller-6b59c6d776-sjp8v.higress-system resources:0 size:0B
2025-02-19T08:50:30.546879Z     info    ads     networking.istio.io/v1beta1/ProxyConfig: PUSH for node:higress-controller-6b59c6d776-sjp8v.higress-system resources:0 size:0B
2025-02-19T08:50:30.546900Z     info    ads     networking.istio.io/v1alpha3/Sidecar: PUSH for node:higress-controller-6b59c6d776-sjp8v.higress-system resources:0 size:0B
2025-02-19T08:50:30.546923Z     info    ads     telemetry.istio.io/v1alpha1/Telemetry: PUSH for node:higress-controller-6b59c6d776-sjp8v.higress-system resources:0 size:0B
2025-02-19T08:50:30.547538Z     info    ingress Found 0 number of basic auth
2025-02-19T08:50:30.547555Z     info    ingress Found 0 number of envoyFilters
2025-02-19T08:50:30.547564Z     info    ingress resource type networking.istio.io/v1alpha3/VirtualService, ingress number 7, convert configs number 4
2025-02-19T08:50:30.547725Z     info    ads     networking.istio.io/v1alpha3/VirtualService: PUSH for node:higress-controller-6b59c6d776-sjp8v.higress-system resources:4 size:2.0kB
2025-02-19T08:50:30.548029Z     info    ingress resource type extensions.istio.io/v1alpha1/WasmPlugin, ingress number 7, convert configs number 7
2025-02-19T08:50:30.548913Z     info    ads     extensions.istio.io/v1alpha1/WasmPlugin: PUSH for node:higress-controller-6b59c6d776-sjp8v.higress-system resources:7 size:12.6kB

@johnlanni
Copy link
Collaborator

可能是2.0.6引入的LDS缓存导致的,2.0.7已经修复,可以升级到2.0.7看下

@jingzhe6414
Copy link
Author

可能是2.0.6引入的LDS缓存导致的,2.0.7已经修复,可以升级到2.0.7看下

升级后正常。
另外2.0.7好像还是有loki启动报权限的问题 #1668

@CH3CHO
Copy link
Collaborator

CH3CHO commented Feb 20, 2025

可能是2.0.6引入的LDS缓存导致的,2.0.7已经修复,可以升级到2.0.7看下

升级后正常。 另外2.0.7好像还是有loki启动报权限的问题 #1668

这个权限的问题还没处理。我后面找时间改一下。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants