1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

OpenShift Local に IBM API Connectをインストールする

Posted at

はじめに

IBMが提供するAPI管理基盤のプロダクトに「IBM API Connect」があります。
公式ドキュメントにインストール手順は記載されているものの、多くのIT製品マニュアルと同様に、初めて触れる方には少し難しく感じられるかもしれません。そこで当記事では、インストール手順の整理を行います。
当記事の狙いは、インストールの全体像をつかみ作業工数を見積りやすくすること、および苦手意識なくポジティブに作業を進められるようアシストすることです。正規の手順は必ず公式ドキュメントを参照してください。

前提条件など

  • API Connectのバージョン: 10.0.8.3
  • インストール先: OpenShift Local (バージョン4.19)
  • 対象: 単一の名前空間へのインストール手順(異なる名前空間にインストールする手順もあります)

インストールには、有効なエンタイトルメントキーが必要になります

インストールの流れ

「事前準備」「オペレーター追加」「サブシステム単位のインストール」の3ステップで進めます

次の手順でインストールを進めます。

  • 事前準備
  • オペレーターの準備
    • インストール用プラグインの取得
    • オブジェクトの作成
    • オペレーターカタログの登録
    • サブスクリプションの登録
  • 証明書発行者の設定
  • サブシステムのインストール
    • マネジメント
    • ゲートウェイ
    • ポータル
    • アナリティクス

正規手順はコチラを参照してください。当記事では、以下の点で公式ドキュメントと少し異なります。

  • 説明の流れを考慮し、手順の順序を若干変更しています
  • Webコンソールでの操作になるべく読み替えて、作業内容を直感的に理解できるようにしています
  • 正常終了を検証する手順の一部を省略しています(必要に応じてドキュメントを参照してください)

事前準備

サブシステム毎の設定

IBM API Connectは、マネジメント、ゲートウェイ、ポータル、アナリティクスの4つのサブシステムで構成されています。各サブシステムを起動するための設定値を検討しておきます。これは導入設計における重要な工程であり、契約に基づく指定も必要です。
実行にあたってのリソース要件は Software Product Compatibility Reports が参考になります。ここから「API Connect」で検索し、対象リリースの「Detailed System Requirements」を参照してください。

変数 当記事での設定値 説明
$APP_PRODUCT_VERSION 10.0.8.3 APIConnectのバージョンを指定します。
$PROFILE(マネジメント) n1xc2.m16 各サブシステムのサイジング指定です。nがレプリカ数、cがコア数、mがメモリです。
このページの下の各サブシステム別ページから必要なパターンを選択します。ここでは最低ラインのスペックを指定します。
$PROFILE(ゲートウェイ) n1xc1.m8 同上
$PROFILE(ポータル) n1xc2.m8 同上
$PROFILE(アナリティクス) n1xc2.m16 同上
$STACK_HOST apps-crc.testing サブドメインを指定します。
$STORAGE_CLASS crc-csi-hostpath-provisioner 永久ボリュームに使用されるストレージクラス。今回は全サブシステムで同じデフォルトストレージを使用します。
$LICENSE_ACCEPTANCE true ライセンスへの同意を示す設定です。
$LICENSE_USE nonproduction 契約上の利用形態に合わせて指定します。
$LICENSE_ID L-HTFS-UAXYM3 このページから、製品・バージョンに基づいたIDを選択します。
$STORAGE_TYPE shared アナリティクスで使用するストレージの形式を指定します。
$DATA_VOLUME_SIZE 10Gi アナリティクスのデータ格納用ストレージサイズです。サイズ不明の場合は500Giが推奨されています。

オペレーター設定値の取得

インストールするバージョンによって、オペレーターカタログの設定パラメーターが変わります。
コチラのページを参考に、次の値を控えておいてください。

項目 10.0.8.3の場合の値
API Connectオペレータバージョン 5.5.0
Foundational Services の CASE バージョン 4.6.2
API Connect オペレーター・チャネル v5.5-sc2

オブジェクト名の設定

インストールにあたり、以下のオブジェクトに名前を割り当てる必要があります。あらかじめ名前を準備しておいてください。

オブジェクト 当記事での命名
プロジェクト名 apic-prj-01
オペレーターグループ名 apic-ope-grp-01

ライセンスキーの取得

ライセンスと紐づけられたIBM IDでIBMコンテナ・ライブラリにアクセスし、ライセンス・キーを取得します。このキーは、後でシークレット作成に使用します。

OpenShiftユーザーの準備

適切な権限を持つユーザーおよび認証情報を準備してください。当記事では管理者ユーザー(kubeadmin)で検証しています。

OpenShiftに接続可能なLinux端末の準備

ocコマンドを実行でき、OpenShiftに接続可能な環境を準備してください。

OpenShift Localのリソース設定変更

インストール作業前に以下のコマンドでOpenShift Localの設定を変更しています。
これらの設定は、不要になったら crc config unset XXXX で初期状態に戻せます。

crc config set memory 49152
crc config set disk-size 300
crc config set cpus 10

デフォルトのメモリは10.5GBですが、ログ上でメモリアロケートに失敗する傾向が見られたため、48GBに変更しました(検証では32GBでもアナリティクスが起動しませんでした:worried:)。ご利用の環境と必要に応じて適宜変更してください。
また、デフォルトのディスク容量は30GBですが、インストールには不足:hushed:するため300GBに拡張します。必要なディスク容量は設計で決めるべきですが、今回は一時的にこのサイズを使用します。
デフォルトのCPUは4ですが、これではマネジメントのDBが起動しなかった:cry:ため、これも環境が許す範囲で変更しています。

オペレーターの準備

IBMオペレーターカタログを追加してOperatorHubから製品を導入するパターンもありますが、API Connectでは手動でこれらの作業を行います。

インストール用プラグインの取得

CLIを使用します

以下のコマンドでプラグインをダウンロード、展開し、利用可能な状態にします。詳細説明はコチラを参照してください。

curl -L https://github.com/IBM/ibm-pak/releases/download/v1.18.2/oc-ibm_pak-linux-amd64.tar.gz -o oc-ibm_pak-linux-amd64.tar.gz
tar -xf oc-ibm_pak-linux-amd64.tar.gz
sudo mv oc-ibm_pak-linux-amd64 /usr/local/bin/oc-ibm_pak

オブジェクトの作成

Webコンソールを使用します

Webコンソールにログインし、3つのオブジェクトを登録します。

プロジェクトの作成

事前に決めた名前でプロジェクトを作成します。

オペレーターグループの作成

以下のYAMLをWebコンソール右上の「YAMLのインポート」に貼り付けて、「作成」をクリックしてオペレーターグループを作成します。
:point_up:名前は事前定義にあわせて変更済です。必要に応じて修正してください。

apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
  name: apic-ope-grp-01
  namespace: apic-prj-01
spec:
  targetNamespaces:
  - apic-prj-01

シークレットの作成

以下の設定でシークレットを追加します。メニューから Workloads > シークレット を選択し、イメージのプルシークレットとして作成します。
:point_up:シークレット追加前に、今回作成したプロジェクトが選択されていることを確認してください。

項目
シークレット名 ibm-entitlement-key
認証タイプ イメージレジストリーの認証情報
レジストリーサーバーのアドレス cp.icr.io
ユーザー名 cp
パスワード (あなたのライセンスキー)

オペレーターカタログの登録

CLIを使用します

まずOpenShiftにログインします。

oc login -u kubeadmin -n apic-prj-01 https://api.crc.testing:6443

次に、API Connectのカタログソースを追加します。CASE_VERSIONは、事前準備で取得した「API Connectオペレータバージョン」を指定してください。

export CASE_NAME=ibm-apiconnect CASE_VERSION=5.5.0 ARCH=amd64
oc ibm-pak get ${CASE_NAME} --version ${CASE_VERSION}
oc ibm-pak generate mirror-manifests ${CASE_NAME} icr.io --version ${CASE_VERSION}
oc apply -f ~/.ibm-pak/data/mirror/${CASE_NAME}/${CASE_VERSION}/catalog-sources.yaml

続いて、IBM Cloud Pak foundational services (共通サービス) カタログソースを追加します。CASE_VERSIONは、事前準備で取得した「Foundational Services の CASE バージョン」を指定してください。
:writing_hand:3つのocコマンドはAPIConnectのそれと同じですので、コマンド履歴から再実行するとよいでしょう。

export CASE_NAME=ibm-cp-common-services CASE_VERSION=4.6.2 ARCH=amd64
oc ibm-pak get ${CASE_NAME} --version ${CASE_VERSION}
oc ibm-pak generate mirror-manifests ${CASE_NAME} icr.io --version ${CASE_VERSION}
oc apply -f ~/.ibm-pak/data/mirror/${CASE_NAME}/${CASE_VERSION}/catalog-sources.yaml

サブスクリプションの登録(API Connect)

Webコンソールを使用します

以下のYAMLをWebコンソール右上の「YAMLのインポート」に貼り付けて、「作成」をクリックしてサブスクリプションを作成します。
:point_up:名前などは事前定義にあわせて変更済です。必要に応じて修正してください。

apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: ibm-apiconnect
  namespace: apic-prj-01
spec:
  channel: v5.5-sc2 
  name: ibm-apiconnect
  source: ibm-apiconnect-catalog
  sourceNamespace: openshift-marketplace

「CatalogSourceの正常性が不明」とのメッセージが表示される場合がありますが、しばらくすると消えます。インストールプロセスが進行するまで待ちましょう。

ここまで正常に完了すれば、Webコンソールの「インストール済のOperator」に「IBM DataPower Gateway」「IBM API Connect」の2つのオペレーターが表示されます。

サブスクリプションの登録(IBM Common Service)

Webコンソールを使用します

以下のYAMLをWebコンソール右上の「YAMLのインポート」に貼り付けて、「作成」をクリックしてサブスクリプションを作成します。
:point_up:名前は事前定義にあわせて変更済です、必要に応じて修正してください。

spec/channelは元ドキュメントの記載がやや不明瞭ですが、今回v4.6を指定します。

apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: ibm-common-service-operator
  namespace: apic-prj-01
spec:
  channel: v4.6
  name: ibm-common-service-operator
  source: opencloud-operators
  sourceNamespace: openshift-marketplace

正常に完了すると、Webコンソールの「インストール済のOperator」に「IBM Cloud Pak foundational services」のオペレーターが表示されます。

証明書発行者の設定

Webコンソールを使用します

cert-managerの追加

OperatorHubで「cert-manager Operator for Red Hat OpenShift」で検索し、インストールします。オプションはすべてデフォルトのままです。

証明書発行者の設定

以下のYAMLをWebコンソール右上の「YAMLのインポート」に貼り付けて、「作成」をクリックします。内容を変更する箇所はありません。
:point_up:インポートする際は、左上のプロジェクトリストで今回作成したプロジェクトが選択されていることを確認してください。これ以降の手順でも、必ずこのプロジェクトを対象にインポートします。

設定用のYAML(クリックして表示)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

---

apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
  name: selfsigning-issuer
  labels: {
    app.kubernetes.io/instance: "management",
    app.kubernetes.io/managed-by: "ibm-apiconnect",
    app.kubernetes.io/name: "selfsigning-issuer"
  }
spec:
  selfSigned: {}
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
  name: ingress-ca
  labels: {
    app.kubernetes.io/instance: "management",
    app.kubernetes.io/managed-by: "ibm-apiconnect",
    app.kubernetes.io/name: "ingress-ca"
  }
spec:
  duration: 87600h # 10 years
  renewBefore: 720h # 30 days
  privateKey:
    rotationPolicy: Always
  secretName: ingress-ca
  commonName: "ingress-ca"
  usages:
  - digital signature
  - key encipherment
  - cert sign
  isCA: true
  issuerRef:
    name: selfsigning-issuer
    kind: Issuer
  secretTemplate:
    labels:
      app.kubernetes.io/instance: "management"
      app.kubernetes.io/managed-by: "ibm-apiconnect"
      app.kubernetes.io/name: "ingress-ca"
---
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
  name: ingress-issuer
  labels: {
    app.kubernetes.io/instance: "management",
    app.kubernetes.io/managed-by: "ibm-apiconnect",
    app.kubernetes.io/name: "ingress-issuer"
  }
spec:
  ca:
    secretName: ingress-ca
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
  name: portal-admin-client
  labels: {
    app.kubernetes.io/instance: "management",
    app.kubernetes.io/managed-by: "ibm-apiconnect",
    app.kubernetes.io/name: "portal-admin-client"
  }
spec:
  subject:
    organizations:
    - cert-manager
  commonName: portal-admin-client
  secretName: portal-admin-client
  issuerRef:
    name: ingress-issuer
  usages:
  - "client auth"
  - "signing"
  - "key encipherment"
  duration: 17520h # 2 years
  renewBefore: 720h # 30 days
  privateKey:
    rotationPolicy: Always
  secretTemplate:
    labels:
      app.kubernetes.io/instance: "management"
      app.kubernetes.io/managed-by: "ibm-apiconnect"
      app.kubernetes.io/name: "portal-admin-client"
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
  name: gateway-client-client
  labels: {
    app.kubernetes.io/instance: "management",
    app.kubernetes.io/managed-by: "ibm-apiconnect",
    app.kubernetes.io/name: "gateway-client-client"
  }
spec:
  subject:
    organizations:
    - cert-manager
  commonName: gateway-client-client
  secretName: gateway-client-client
  issuerRef:
    name: ingress-issuer
  usages:
  - "client auth"
  - "signing"
  - "key encipherment"
  duration: 17520h # 2 years
  renewBefore: 720h # 30 days
  privateKey:
    rotationPolicy: Always
  secretTemplate:
    labels:
      app.kubernetes.io/instance: "management"
      app.kubernetes.io/managed-by: "ibm-apiconnect"
      app.kubernetes.io/name: "gateway-client-client"
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
  name: analytics-ingestion-client
  labels: {
    app.kubernetes.io/instance: "management",
    app.kubernetes.io/managed-by: "ibm-apiconnect",
    app.kubernetes.io/name: "analytics-ingestion-client"
  }
spec:
  subject:
    organizations:
    - cert-manager
  commonName: analytics-ingestion-client
  secretName: analytics-ingestion-client
  issuerRef:
    name: ingress-issuer
  usages:
  - "client auth"
  - "signing"
  - "key encipherment"
  duration: 17520h # 2 years
  renewBefore: 720h # 30 days
  privateKey:
    rotationPolicy: Always
  secretTemplate:
    labels:
      app.kubernetes.io/instance: "management"
      app.kubernetes.io/managed-by: "ibm-apiconnect"
      app.kubernetes.io/name: "analytics-ingestion-client"
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
  name: gateway-service
  labels: {
    app.kubernetes.io/instance: "gatewaycluster",
    app.kubernetes.io/managed-by: "ibm-apiconnect",
    app.kubernetes.io/name: "gateway-service"
  }
spec:
  subject:
    organizations:
    - cert-manager
  commonName: gateway-service
  secretName: gateway-service
  issuerRef:
    name: ingress-issuer
  usages:
  - "client auth"
  - "signing"
  - "key encipherment"
  duration: 17520h # 2 years
  renewBefore: 720h # 30 days
  privateKey:
    rotationPolicy: Always
  secretTemplate:
    labels:
      app.kubernetes.io/instance: "gatewaycluster"
      app.kubernetes.io/managed-by: "ibm-apiconnect"
      app.kubernetes.io/name: "gateway-service"
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
  name: gateway-peering
  labels: {
    app.kubernetes.io/instance: "gatewaycluster",
    app.kubernetes.io/managed-by: "ibm-apiconnect",
    app.kubernetes.io/name: "gateway-peering"
  }
spec:
  subject:
    organizations:
    - cert-manager
  commonName: gateway-peering
  secretName: gateway-peering
  issuerRef:
    name: ingress-issuer
  usages:
  - "server auth"
  - "client auth"
  - "signing"
  - "key encipherment"
  duration: 17520h # 2 years
  renewBefore: 720h # 30 days
  privateKey:
    rotationPolicy: Always
  secretTemplate:
    labels:
      app.kubernetes.io/instance: "gatewaycluster"
      app.kubernetes.io/managed-by: "ibm-apiconnect"
      app.kubernetes.io/name: "gateway-peering"

サブシステムのインストール:マネジメント

Webコンソールを使用します

インストールYAMLの編集と適用

以下のマネジメントサブシステム構築用のYAMLファイルをテキストエディタにコピーし、$xxxxとなっている変数を、事前準備で整理した値にすべて置き換えます。
変数の置き換えが完了したら(YAMLから変数がなくなったら)、Webコンソール右上の「YAMLのインポート」に修正後のYAMLを貼り付け、「作成」をクリックしてください。

:writing_hand:他の3つのサブシステムでも同様の作業を行います。置換ミスがないように、テキストエディタの置換機能などを活用すると良いでしょう。

マネジメント設定用のYAML(クリックして表示)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#


apiVersion: management.apiconnect.ibm.com/v1beta1
kind: ManagementCluster
metadata:
  name: management
  labels:
    app.kubernetes.io/instance: management
    app.kubernetes.io/managed-by: ibm-apiconnect
    app.kubernetes.io/name: management
  annotations:
    apiconnect-operator/cp4i: "false"
spec:
  version: $APP_PRODUCT_VERSION
  profile: $PROFILE
  portal:
    admin:
      secretName: portal-admin-client
  analytics:
    ingestion:
      secretName: analytics-ingestion-client
  gateway:
    client:
      secretName: gateway-client-client
  cloudManagerEndpoint:
    annotations:
      cert-manager.io/issuer: ingress-issuer
    hosts:
    - name: admin.$STACK_HOST
      secretName: cm-endpoint
  apiManagerEndpoint:
    annotations:
      cert-manager.io/issuer: ingress-issuer
    hosts:
    - name: manager.$STACK_HOST
      secretName: apim-endpoint
  platformAPIEndpoint:
    annotations:
      cert-manager.io/issuer: ingress-issuer
    hosts:
    - name: api.$STACK_HOST
      secretName: api-endpoint
  consumerAPIEndpoint:
    annotations:
      cert-manager.io/issuer: ingress-issuer
    hosts:
    - name: consumer.$STACK_HOST
      secretName: consumer-endpoint
  consumerCatalogEndpoint:
    annotations:
      cert-manager.io/issuer: ingress-issuer
    hosts: 
    - name: consumer-catalog.myhost.subnet.example.com
      secretName: consumer-catalog-endpoint
  databaseVolumeClaimTemplate:
    storageClassName: $STORAGE_CLASS
  microServiceSecurity: certManager
  certManagerIssuer:
    name: selfsigning-issuer
    kind: Issuer
  license:
    accept: $LICENSE_ACCEPTANCE
    use: $LICENSE_USE
    license: '$LICENSE_ID'

サブシステムのインストール:ゲートウェイ

Webコンソールを使用します

シークレットの作成

メニューから、Workloads > シークレット を選択します。改めて、今回使用するプロジェクトが選択されていることを確認してください。
キーと値のシークレット」として作成します。以下の値をそのまま使用してください。

項目
シークレット名 admin-secret
キー password
admin

インストールYAMLの編集と適用

マネジメントサブシステムと同様に、以下のYAMLを対象に変数置換を行い、「作成」をクリックしてください。

:point_up:ドキュメントにはv6とv5の2パターンがありますが、この記事では新しいv6を選択します。syslogConfigは無効のままにしておきます。

ゲートウェイ設定用のYAML(クリックして表示)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# 
#     http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#


apiVersion: gateway.apiconnect.ibm.com/v1beta1
kind: GatewayCluster
metadata:
  name: gwv6
  labels:
    app.kubernetes.io/instance: gateway
    app.kubernetes.io/managed-by: ibm-apiconnect
    app.kubernetes.io/name: gwv6
  annotations:
    apiconnect-operator/cp4i: "false"
spec:
  version: $APP_PRODUCT_VERSION
  profile: $PROFILE
  apicGatewayServiceV5CompatibilityMode: false
  mgmtPlatformEndpointCASecret:
    secretName: ingress-ca
  mgmtPlatformEndpointSvcCASecret:
    secretName: management-ca
  gatewayEndpoint:
    annotations:
      cert-manager.io/issuer: ingress-issuer
    hosts:
    - name: rgw.$STACK_HOST
      secretName: gwv6-endpoint
  gatewayManagerEndpoint:
    annotations:
      cert-manager.io/issuer: ingress-issuer
    hosts:
    - name: rgwd.$STACK_HOST
      secretName: gwv6-manager-endpoint
  apicGatewayServiceTLS:
    secretName: gateway-service
  apicGatewayPeeringTLS:
    secretName: gateway-peering
  datapowerLogLevel: 3
  license:
    accept: $LICENSE_ACCEPTANCE
    use: $LICENSE_USE
    license: '$LICENSE_ID'
  tokenManagementService:
    enabled: true
    storage:
      storageClassName: $STORAGE_CLASS
      volumeSize: 30Gi
  adminUser:
    secretName: admin-secret
  mtlsValidateClient: true
  # syslogConfig:
  #   enabled: false # if true, provide below details
  #   remoteHost: $DATAPOWER_SYSLOG_TCP_REMOTE_HOST # must be a string
  #   remotePort: $DATAPOWER_SYSLOG_TCP_REMOTE_PORT # must be an int
  #   secretName: $DATAPOWER_SYSLOG_TCP_TLS_SECRET # must be a string

サブシステムのインストール:ポータル

Webコンソールを使用します

インストールYAMLの編集と適用

マネジメントサブシステムと同様に、以下のYAMLを対象に変数置換を行い、「作成」をクリックしてください。

:point_up:変数のほかに、データを格納するボリュームの容量を設計に合わせて変更する必要があります。添付のYAMLでは指定可能な最小値を使用しています。

ポータル設定用のYAML(クリックして表示)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#


apiVersion: portal.apiconnect.ibm.com/v1beta1
kind: PortalCluster
metadata:
  name: portal
  labels:
    app.kubernetes.io/instance: portal
    app.kubernetes.io/managed-by: ibm-apiconnect
    app.kubernetes.io/name: portal
  annotations:
    apiconnect-operator/cp4i: "false"
spec:
  version: $APP_PRODUCT_VERSION
  profile: $PROFILE
  mgmtPlatformEndpointCASecret:
    secretName: ingress-ca
  mgmtConsumerEndpointCASecret:
    secretName: ingress-ca
  mgmtPlatformEndpointSvcCASecret:
    secretName: management-ca
  mgmtConsumerEndpointSvcCASecret:
    secretName: management-ca
  portalAdminEndpoint:
    annotations:
      cert-manager.io/issuer: ingress-issuer
    hosts:
    - name: api.portal.$STACK_HOST
      secretName: portal-admin
  portalUIEndpoint:
    annotations:
      cert-manager.io/issuer: ingress-issuer
    hosts:
    - name: portal.$STACK_HOST
      secretName: portal-web
  databaseVolumeClaimTemplate:
    storageClassName: $STORAGE_CLASS
    volumeSize: 30Gi
  databaseLogsVolumeClaimTemplate:
    storageClassName: $STORAGE_CLASS
    volumeSize: 12Gi
  webVolumeClaimTemplate:
    storageClassName: $STORAGE_CLASS
    volumeSize: 20Gi
  backupVolumeClaimTemplate:
    storageClassName: $STORAGE_CLASS
    volumeSize: 30Gi
  adminVolumeClaimTemplate:
    storageClassName: $STORAGE_CLASS
    volumeSize: 20Gi
  certVolumeClaimTemplate:
    storageClassName: $STORAGE_CLASS
    volumeSize: 4Gi
  adminClientSubjectDN: CN=portal-admin-client,O=cert-manager
  microServiceSecurity: certManager
  certManagerIssuer:
    name: selfsigning-issuer
    kind: Issuer
  license:
    accept: $LICENSE_ACCEPTANCE
    use: $LICENSE_USE
    license: '$LICENSE_ID'

サブシステムのインストール:アナリティクス

Webコンソールを使用します

インストールYAMLの編集と適用

マネジメントサブシステムと同様に、以下のYAMLを対象に変数置換を行い、「作成」をクリックしてください。

記事記載時点では、metadata下のannotationsはインデントが不適切のようです:frowning2:。metadataの1段下が適切と思われるため、当記事の記載を参考にしてください。

アナリティクス設定用のYAML(クリックして表示)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# 
#     http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

apiVersion: analytics.apiconnect.ibm.com/v1beta1
kind: AnalyticsCluster
metadata:
  name: analytics
  labels:
    app.kubernetes.io/instance: analytics
    app.kubernetes.io/managed-by: ibm-apiconnect
    app.kubernetes.io/name: analytics
  annotations:
    apiconnect-operator/cp4i: "false"
spec:
  version: $APP_PRODUCT_VERSION
  license:
    accept: $LICENSE_ACCEPTANCE
    use: $LICENSE_USE
    license: '$LICENSE_ID'
  profile: $PROFILE
  mgmtPlatformEndpointCASecret:
    secretName: ingress-ca
  mgmtPlatformEndpointSvcCASecret:
    secretName: management-ca
  microServiceSecurity: certManager
  certManagerIssuer:
    name: selfsigning-issuer
    kind: Issuer
  ingestion:
    endpoint:
      annotations:
        cert-manager.io/issuer: ingress-issuer
      hosts: 
      - name: ai.$STACK_HOST
        secretName: analytics-ai-endpoint
    clientSubjectDN: CN=analytics-ingestion-client,O=cert-manager
  storage:
    type: $STORAGE_TYPE
    shared:
      volumeClaimTemplate:
        storageClassName: $STORAGE_CLASS
        volumeSize: $DATA_VOLUME_SIZE 
   #master: # uncomment this section if you set storage.type = dedicated.
   #  volumeClaimTemplate:
   #    storageClassName: $STORAGE_CLASS

API Connect Cloud Manager UIへのアクセス

Webコンソールを使用します

マネジメントサブシステムの画面にログインするため、接続先のURLと管理者パスワードを取得します。

接続先URL

メニューの ネットワーク > Routes から、management-adminというルートを見つけ、定義されたURLを控えておきます。今回の設定では https://admin.apps-crc.testing になります。

管理者パスワード

メニューの workloads > シークレット から、management-admin-secretを見つけ、パスワードをコピーします。
もし同名のシークレットが見つからない場合、以下のコマンドで名前を確認してください。

oc get secret -n apic-prj-01 | grep management-admin-secret

ログイン

取得したURLにブラウザでアクセスし、ユーザー名admin、パスワードは先ほど取得した管理者パスワードでログインしてください。初回ログイン時にはパスワード変更が求められ、その後、管理画面に到達します。
qiita-square

ここまでで、当記事で解説するインストール手順は完了です:tada:
この後も初期設定などが必要になります。

トラブルシュート

アナリティクスサブシステムの起動に至るまで、いくつかの問題に遭遇しました。ここでは、その症状と原因、そして追跡方法を共有します。

躓いた症状と原因

症状 原因
プロセス中にエラーが発生する 事前準備で設定した値に矛盾がある、または必要なオブジェクトが作成されていない
インストールプロセスがPendingなどから次に進まない 環境のリソース不足

追跡手順

CRCのログ確認

以下のコマンドでログを確認できます。行数が多く見づらいですが、主にインストールプロセスの前半(オペレーター関連)で役に立ちました。

oc adm node-logs crc --tail=30

サブシステムのログ確認

各サブシステムの状況は以下の手順で確認します。サブシステムのインストールがうまくいかない場合に有効です。

  • Workloads > Deploymentsで、参照先のオブジェクトをクリックします(問題がある場合は、Podのステータスが1/1になっていないことが多いので、これを目安に探します)。
  • Podsタブから、実行中のPodをクリックします。
  • イベントタブで進行状況を確認します。問題が発生している場合、ここにヒントとなるメッセージが表示されていることが多いです。

サブシステムの起動状況確認

各サブシステムの起動状況を確認する手順です。

  • 管理 > CustomResourceDefinitionsを開き、サブシステムに応じたカスタムリソースを探します
サブシステム 名前
マネジメント ManagementCluster
ゲートウェイ GatewayCluster
ポータル PortalCluster
アナリティクス AnalyticsCluster
  • 見つけたらクリックし、「インスタンス」タブで実行中のインスタンスを開きます
  • 条件:ReadyがTrueになっていれば正常です

おわりに

ITプロダクトをマニュアル通りにインストールするのは、その分量の多さや分かりづらさから気が引けてしまうことも少なくありません。しかし、全体像を掴んでしまえば、手順自体は思ったよりシンプルだと感じることが多いものです。
サイジングなどの設計は簡単とは言えないかもしれませんが:sweat:、まずは恐れることなく、一歩ずつ取り組んでみましょう!

1
0
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?