2.23.5. 3scale 外部 ServiceEntry オブジェクトの適用
threescale-wasm-auth モジュールに 3scale に対するリクエストを承認させるには、モジュールが 3scale サービスにアクセスできる必要があります。これを Red Hat OpenShift Service Mesh 内で行うには、外部の ServiceEntry オブジェクトを適用し、対応する DestinationRule オブジェクトを適用して HTTPS プロトコルを使用するための TLS 設定を行います。
カスタムリソース (CR) は、Service Management API および Account Management API のバックエンドおよびシステムコンポーネントのために、Service Mesh 内から 3scale Hosted (SaaS) への安全なアクセスのためのサービスエントリーと宛先ルールを設定します。Service Management API は、各リクエストの承認ステータスのクエリーを受信します。Account Management API は、サービスの API 管理設定を提供します。
手順
以下の外部
ServiceEntryCR および関連する 3scale Hosted バックエンド 用のDestinationRuleCR をクラスターに適用します。ServiceEntryCR をservice-entry-threescale-saas-backend.ymlというファイルに追加します。ServiceEntry CR
apiVersion: networking.istio.io/v1beta1 kind: ServiceEntry metadata: name: service-entry-threescale-saas-backend spec: hosts: - su1.3scale.net ports: - number: 443 name: https protocol: HTTPS location: MESH_EXTERNAL resolution: DNSDestinationRuleCR をdestination-rule-threescale-saas-backend.ymlというファイルに追加します。DestinationRule CR
apiVersion: networking.istio.io/v1beta1 kind: DestinationRule metadata: name: destination-rule-threescale-saas-backend spec: host: su1.3scale.net trafficPolicy: tls: mode: SIMPLE sni: su1.3scale.net以下のコマンドを実行して、3scale Hosted バックエンドの外部
ServiceEntryCR をクラスターに適用して保存します。$ oc apply -f service-entry-threescale-saas-backend.yml以下のコマンドを実行して、3scale Hosted バックエンドの外部
DestinationRuleCR をクラスターに適用して保存します。$ oc apply -f destination-rule-threescale-saas-backend.yml
以下の外部
ServiceEntryCR および関連する 3scale Hosted システム 用のDestinationRuleCR をクラスターに適用します。ServiceEntryCR をservice-entry-threescale-saas-system.ymlというファイルに追加します。ServiceEntry CR
apiVersion: networking.istio.io/v1beta1 kind: ServiceEntry metadata: name: service-entry-threescale-saas-system spec: hosts: - multitenant.3scale.net ports: - number: 443 name: https protocol: HTTPS location: MESH_EXTERNAL resolution: DNSDestinationRuleCR をdestination-rule-threescale-saas-system.ymlというファイルに追加します。DestinationRule CR
apiVersion: networking.istio.io/v1beta1 kind: DestinationRule metadata: name: destination-rule-threescale-saas-system spec: host: multitenant.3scale.net trafficPolicy: tls: mode: SIMPLE sni: multitenant.3scale.net以下のコマンドを実行して、3scale Hosted システムの外部
ServiceEntryCR をクラスターに適用して保存します。$ oc apply -f service-entry-threescale-saas-system.yml以下のコマンドを実行して、3scale Hosted システムの外部
DestinationRuleCR をクラスターに適用して保存します。$ oc apply -f <destination-rule-threescale-saas-system.yml>
または、メッシュ内の 3scale サービスをデプロイできます。メッシュ内 3scale サービスをデプロイするには、3scale をデプロイしてデプロイにリンクすることにより、CR 内のサービスの場所を変更します。