ext_authz 集群 'x' 不存在

ext_authz cluster 'x' does not exist

我正在尝试使用 istio 进行 jwt 验证。我在端口 3000 上有一个标签为 app=auth-verify 运行 的应用程序,它有 1 个端点 /auth,它将检查授权 header。 主应用程序有标签 app=backend 期望 auth-verify 应用程序验证 jwt 并添加 header x-authenticated。下面是我的 EnvoyFilter CRD。

apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
  name: jwt-verification
  namespace: default
spec:
  workloadSelector:
    labels:
      app=backend
  configPatches:
    - applyTo: HTTP_FILTER
      match:
        context: SIDECAR_INBOUND
        listener:
          filterChain:
            filter:
              name: "envoy.filters.network.http_connection_manager"
              subFilter:
                name: "envoy.filters.http.router"
      patch:
        operation: INSERT_BEFORE
        filterClass: STATS
        value:
          name: envoy.filters.http.ext_authz
          typed_config:
            "@type": type.googleapis.com/envoy.extensions.filters.http.ext_authz.v3.ExtAuthz
            http_service:
              server_uri:
                uri: http://auth-verify.default.svc.cluster.local:3000/auth
                cluster: outbound|3000||http://auth-verify
                timeout: 5s
            status_on_error:
              code: FailedDependency

当我通过 kubectl logs --tail 1 -f backend-695cf5b89d-nkgps istio-proxy 检查后端 pod 上的日志时,我可以看到此错误。

debug   envoy config    ext_authz cluster 'outbound|3000||http://auth-verify' does not exist
debug   envoy http  [C9552][S4342964409469864253] Sending local reply with details ext_authz_error

我该如何解决这个问题?

我的错误是在簇字符串中添加了 'http://'。 通过更改为 cluster: outbound|3000||auth-verify.default.svc.cluster.local

使其正常工作