搜索

11.3. 使用 Service Mesh 连接 3scale API 管理

download PDF
重要

在 service-mesh/istio-system 命名空间或 info 命名空间中创建 ServiceEntry 自定义资源 (CR) 和 DestinationRule CR。它应该位于包含 ServiceMeshControlPlane 的命名空间中。

要从 Service Mesh 访问 3scale,您必须通过 ServiceEntry CR 和 DestinationRule CR 将租户和后端 URL 配置为外部服务。这可让 threescale-wasm-auth 模块访问处理请求授权的后端,以及从中获取产品配置的系统。

11.3.1. 在 Service Mesh 中添加 3scale API 管理 URL

ServiceEntry 需要允许来自 Service Mesh 中的服务的请求,而 DestinationRule 则可用于为 3scale 服务配置安全连接。

11.3.1.1. 在 Service Mesh 中添加租户 URL

流程

  1. 收集系统租户 URL:

    • 这是用于创建产品的 3scale 管理门户的 URL。
  2. 为系统创建 ServiceEntry

    oc apply -n <info> -f -<<EOF
    apiVersion: networking.istio.io/v1beta1
    kind: ServiceEntry
    metadata:
      name: <service_entry_threescale_system>
    spec:
      hosts:
      - <system_hostname>
      ports:
      - number: 443
        name: https
        protocol: HTTPS
      location: MESH_EXTERNAL
      resolution: DNS
    EOF
  3. 为系统创建 DestinationRule

    oc apply -n <info> -f -<<EOF
    apiVersion: networking.istio.io/v1beta1
    kind: DestinationRule
    metadata:
      name: <destination_rule_threescale_system>
    spec:
      host: <system_hostname>
      trafficPolicy:
        tls:
          mode: SIMPLE
          sni: <system_hostname>
    EOF
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.