10.4. サービスを発見可能にする
OpenShift クラスターにデプロイされた、またはデプロイされる予定の API サービスは、3scale によって検出可能です。これを実現するには、OpenShift Service Object YAML 定義を設定して、以下のメタデータを含めます。
metadata:
labels:
discovery.3scale.net: "true"
annotations:
discovery.3scale.net/scheme: <http | https>
discovery.3scale.net/port: '<port number of the service within the cluster>'
discovery.3scale.net/path: <relative base path of the API backend from the root>
discovery.3scale.net/description-path: <relative or absolute path to the Open API Specification for the API>
記述されたメタデータから、port と scheme は必須の注釈です。
さらに、Service Discovery は、Content-Type ヘッダーが次の値のいずれかである場合にのみ仕様をインポートします。
-
application/swagger+json -
application/vnd.oai.openapi+json -
application/json
注記
ユーザーまたはサービスアカウント (設定された認証モードに応じて) が名前空間とサービスを表示するための適切な権限を持っていることを確認してください。