5.2. capabilities に関連するカスタムリソースのデプロイ
新しく作成したテナントで Openshift Container Platform を使用し、API、メトリクス、および マッピングルール を設定します。
5.2.1. API の作成
以下の手順により、api: api01
というラベルの API を作成します。
手順
Catalog > Installed Operators の順にクリックします。
- Installed Operators のリストで、3scale Operator をクリックします。
- API タブをクリックします。
- Create API をクリックします。
サンプルのコンテンツを消去して以下の YAML 定義をエディターに追加し、続いて Create をクリックします。
apiVersion: capabilities.3scale.net/v1alpha1 kind: API metadata: creationTimestamp: 2019-01-25T13:28:41Z generation: 1 labels: environment: testing name: api01 spec: planSelector: matchLabels: api: api01 description: api01 integrationMethod: apicastHosted: apiTestGetRequest: / authenticationSettings: credentials: apiKey: authParameterName: user-key credentialsLocation: headers errors: authenticationFailed: contentType: text/plain; charset=us-ascii responseBody: Authentication failed responseCode: 403 authenticationMissing: contentType: text/plain; charset=us-ascii responseBody: Authentication Missing responseCode: 403 hostHeader: "" secretToken: Shared_secret_sent_from_proxy_to_API_backend_9603f637ca51ccfe mappingRulesSelector: matchLabels: api: api01 privateBaseURL: https://echo-api.3scale.net:443 metricSelector: matchLabels: api: api01
注記すべてのセレクター (metric、plan、mappingrules) で、特定のラベル
api: api01
が使用されます。複雑なシナリオに対応するために、さらにラベルを追加してセレクターを設定することで、この設定を変更することができます。