3.2. 外部モードでの OpenShift Data Foundation Cluster の作成

OpenShift Data Foundation Operator を Red Hat OpenStack プラットフォームの OpenShift Container Platform にインストールした後に、OpenShift Data Foundation クラスターを新規に作成する必要があります。

前提条件

  • OpenShift Data Foundation 4.8 をデプロイする前に、OpenShift Container Platform のバージョンが 4.8 以上であることを確認してください。
  • OpenShift Data Foundation Operator がインストールされている必要があります。詳細は、Installing OpenShift Data Foundation Operator using the Operator Hub を参照してください。
  • 外部クラスターには、Red Hat Ceph Storage バージョン 4.2z1 以降が必要です。詳細は、この Red Hat Ceph Storage リリースおよび対応する Ceph パッケージバージョンについてのナレッジベースのアーティクル を参照してください。

    Red Hat Ceph Storage クラスターを 4.1.1 以前のバージョンから最新リリースに更新し、これが新規にデプロイされたクラスターではない場合は、Red Hat Ceph Storage クラスターで CephFS プールのアプリケーションタイプを手動で設定し、外部モードで CephFS PVC の作成を有効にする必要があります。

    詳細は、外部モードでの CephFS PVC の作成のトラブルシューティング を参照してください。

  • Red Hat Ceph Storage では、Ceph Dashboard がインストールされ、設定されている必要があります。詳細は、Ceph Dashboard のインストールおよびアクセス について参照してください。
  • Red Hat では、外部の Red Hat Ceph Storage クラスターでは、PG Autoscaler を有効にすることを推奨します。詳細は、Red Hat Ceph Storage ドキュメントの The placement group autoscaler セクションを参照してください。
  • 外部 Ceph クラスターには、既存の RBD プールを使用できるように事前に設定されている必要があります。これがない場合は、OpenShift Data Foundation のデプロイメントに進む前に、Red Hat Ceph Storage の管理者に問い合わせてこれを作成してください。Red Hat は、OpenShift Data Foundation クラスターごとに別個のプールを使用することを推奨します。

手順

  1. Operators → Installed Operators をクリックし、インストールされた Operator をすべて表示します。

    選択された Projectopenshift-storage であることを確認します。

  2. Storage Cluster の OpenShift Data FoundationCreate Instance リンクをクリックします。
  3. Mode を External に選択します。デフォルトでは、Internal はデプロイメントモードとして選択されます。

    図3.1 Create Storage Cluster 形式の外部クラスターへの接続

    Screenshot shows connect to external cluster section after you select mode as external where you can download the python script and then upload the RHCS json file.
  4. Connect to external cluster セクションで、Download Script リンクをクリックして、Ceph クラスターの詳細を抽出するために python スクリプトをダウンロードします。
  5. Red Hat Ceph Storage (RHCS) クラスターの詳細を抽出するには、RHCS 管理者に問い合わせた上で Red Hat Ceph Storage でダウンロードした python スクリプトを admin key を使用して実行します。

    1. RHCS ノードで以下のコマンドを実行し、利用可能な引数の一覧を表示します。

      # python3 ceph-external-cluster-details-exporter.py --help
      重要

      Red Hat Ceph Storage 4.x クラスターが Red Hat Enterprise Linux 7.x (RHEL 7.x) クラスターにデプロイされている場合は、python3 ではなく python を使用します。

      注記

      MON コンテナー内 (コンテナー化されたデプロイメント) または MON ノード (rpm デプロイメント) からスクリプトを実行することもできます。

    2. RHCS クラスターから外部クラスターの詳細を取得するには、以下のコマンドを実行します。

      # python3 ceph-external-cluster-details-exporter.py \
      --rbd-data-pool-name <rbd block pool name>  [optional arguments]

      以下に例を示します。

      # python3 ceph-external-cluster-details-exporter.py --rbd-data-pool-name ceph-rbd --monitoring-endpoint xxx.xxx.xxx.xxx --monitoring-endpoint-port xxxx --rgw-endpoint xxx.xxx.xxx.xxx:xxxx --run-as-user client.ocs

      上記の例は、以下のようになります。

      • --rbd-data-pool-name は、OpenShift Data Foundation でブロックストレージを提供するために使用される必須のパラメーターです。
      • --rgw-endpoint は任意です。OpenShift Data Foundation の Ceph Rados Gateway でオブジェクトストレージをプロビジョニングする場合に、このパラメーターを指定します。<ip_address>:<port> の形式でエンドポイントを指定します。
      • --monitoring-endpoint は任意です。これは、OpenShift Container Platform クラスターから到達できるアクティブな ceph-mgr の IP アドレスです。指定しない場合には、値が自動的に入力されます。
      • --monitoring-endpoint-port は任意です。これは --monitoring-endpoint で指定された ceph-mgr Prometheus エクスポーターに関連付けられるポートです。指定しない場合には、値が自動的に入力されます。
      • -- run-as-user は、スクリプトで作成される Ceph ユーザーの名前を指定するために使用されるオプションのパラメーターです。このパラメーターを指定しないと、デフォルトのユーザー名 client.healthchecker が作成されます。新規ユーザーのパーミッションは以下のように設定されます。

        • caps: [mgr] はコマンド設定を許可します。
        • caps: [mon] は r を許可し、コマンド quorum_status を許可し、コマンド version を許可します。
        • caps: [osd] allow rwx pool=RGW_POOL_PREFIX.rgw.meta, allow r pool=.rgw.root, allow rw pool=RGW_POOL_PREFIX.rgw.control, allow rx pool=RGW_POOL_PREFIX.rgw.log, allow x pool=RGW_POOL_PREFIX.rgw.buckets.index

          python スクリプトを使用して生成された JSON 出力の例:

          [{"name": "rook-ceph-mon-endpoints", "kind": "ConfigMap", "data": {"data": "xxx.xxx.xxx.xxx:xxxx", "maxMonId": "0", "mapping": "{}"}}, {"name": "rook-ceph-mon", "kind": "Secret", "data": {"admin-secret": "admin-secret", "fsid": "<fs-id>", "mon-secret": "mon-secret"}}, {"name": "rook-ceph-operator-creds", "kind": "Secret", "data": {"userID": "client.healthchecker", "userKey": "<user-key>"}}, {"name": "rook-csi-rbd-node", "kind": "Secret", "data": {"userID": "csi-rbd-node", "userKey": "<user-key>"}}, {"name": "ceph-rbd", "kind": "StorageClass", "data": {"pool": "ceph-rbd"}}, {"name": "monitoring-endpoint", "kind": "CephCluster", "data": {"MonitoringEndpoint": "xxx.xxx.xxx.xxx", "MonitoringPort": "xxxx"}}, {"name": "rook-csi-rbd-provisioner", "kind": "Secret", "data": {"userID": "csi-rbd-provisioner", "userKey": "<user-key>"}}, {"name": "rook-csi-cephfs-provisioner", "kind": "Secret", "data": {"adminID": "csi-cephfs-provisioner", "adminKey": "<admin-key>"}}, {"name": "rook-csi-cephfs-node", "kind": "Secret", "data": {"adminID": "csi-cephfs-node", "adminKey": "<admin-key>"}}, {"name": "cephfs", "kind": "StorageClass", "data": {"fsName": "cephfs", "pool": "cephfs_data"}}, {"name": "ceph-rgw", "kind": "StorageClass", "data": {"endpoint": "xxx.xxx.xxx.xxx:xxxx", "poolPrefix": "default"}}]

    3. JSON 出力を .json 拡張のあるファイルに保存します。

      注記

      OpenShift Data Foundation がシームレスに機能するには、JSON ファイルを使用してアップロードされるパラメーター (RGW エンドポイント、CephFS の詳細、RBD プールなど) が、ストレージクラスターの作成後も RHCS 外部クラスターで変更されないままであることを確認します。

  6. External cluster metadata → Browse をクリックして、JSON ファイルを選択し、アップロードします。

    JSON ファイルの内容が入力され、テキストボックスに表示されます。

    図3.2 JSON ファイルの内容

    Screenshot shows the content of the credentials file after it is uploaded
  7. Create をクリックします。

    Create ボタンは、.json ファイルのアップロード後にのみ有効になります。

検証手順

  1. インストールされたストレージクラスターの最後の Status が緑色のチェックマークと共に Phase: Ready と表示されていることを確認します。

    • Operators → Installed Operators → Storage Cluster のリンクをクリックして、ストレージクラスターのインストールのステータスを表示します。
    • または、Operator Details タブで、Storage Cluster タブをクリックしてステータスを表示できます。
  2. OpenShift Data Foundation、Pod、および StorageClass が正常にインストールされていることを確認するには、Verifying your external mode OpenShift Data Foundation installation を参照してください。