0

大使版本:0.86.1

我正在使用ambassador api gateway v1 我希望大使对后端服务进行身份验证。我在后端服务上配置了以下注释:

 annotations:
    getambassador.io/config: |
      ---
      apiVersion: ambassador/v1
      kind: Mapping
      name: backend-service
      ambassador_id: backend
      prefix: /
      service: backend-service:3000
      timeout_ms: 120000
      ---
      apiVersion: ambassador/v1
      kind: AuthService
      name: authentication-service
      ambassador_id: backend
      auth_service: "auth-service.auth-ns:3000"
      status_on_error:
        code: 502
      timeout_ms: 120000
      allowed_request_headers:
      - "x-api-key"
      allowed_authorization_headers:
      - "solution"

此请求不是通过 auth-service 路由的,当我从不同命名空间中的另一个 pod 调用服务时,即使没有传递 x-api-key 标头,所有请求也会通过: curl http://backend-service.backend-ns: 3000/test 如何使这项工作?我只想在 k8s 集群中调用后端服务?

4

0 回答 0