10.5. 在与 Service Mesh 相同的集群中使用 3scale API 管理
注意
以下流程是向服务网格添加后端 URL 的替代选择。
要让 threescale-wasm-auth
模块授权针对 3scale 的请求,该模块必须有权访问 3scale 服务。您可以通过应用外部 ServiceEntry
对象和用于 TLS 配置的对应 DestinationRule
对象来使用 HTTPS 协议在 Red Hat OpenShift Service Mesh 中执行此操作。
自定义资源(CR)设置服务条目和目的地规则,以便从 Service Mesh 内安全访问 3scale,用于服务管理 API 和帐户管理 API 的后端和系统组件。Service Management API 接收每个请求的授权状态查询。帐户管理 API 为您的服务提供 API 管理配置设置。
流程
为后端创建
ServiceEntry
:oc apply -n <info> -f -<<EOF apiVersion: networking.istio.io/v1beta1 kind: ServiceEntry metadata: name: <service_entry_threescale_backend> spec: hosts: - backend-listener.<3scale_namespace>.svc.cluster.local ports: - number: 80 name: http protocol: HTTP 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_backend> spec: host: backend-listener.<3scale_namespace>.svc.cluster.local EOF