11.3. 使用 Service Mesh 连接 3scale
重要
在 service-mesh/istio-system 命名空间或 info 命名空间中创建 ServiceEntry 自定义资源 (CR) 和 DestinationRule CR。它应该位于包含 ServiceMeshControlPlane 的命名空间中。
要从 Service Mesh 访问 3scale,您必须通过 ServiceEntry 和 DestinationRule (CR) 将租户和后端 URL 配置为外部服务。这可让 threescale-wasm-auth 模块访问处理请求授权的后端,以及从中获取产品配置的系统。
11.3.1. 在 Service Mesh 中添加 3scale URL 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
ServiceEntry 需要允许来自 Service Mesh 中的服务的请求,而 DestinationRule 则可用于为 3scale 服务配置安全连接。
11.3.1.1. 在 Service Mesh 中添加租户 URL 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
流程
收集系统租户 URL:
- 这是用于创建产品的 3scale 管理门户的 URL。
为系统创建
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为系统创建
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