第6章 既存の外部の OpenShift Data Foundation クラスターへのファイルおよびオブジェクトストレージの追加

OpenShift Data Foundation が外部モードで設定されている場合に、Persistent Volume Claim (永続ボリューム要求、PVC) および Object Bucket Claim (オブジェクトバケット要求) 向けにストレージを提供する方法は複数あります。

  • ブロックストレージ用の Persistent Volume Claim (永続ボリューム要求、PVC) は、外部の Red Hat Ceph Storage クラスターから直接提供されます。
  • ファイルストレージ用の Persistent Volume Claim (永続ボリューム要求、PVC) は、メタデータサーバー (MDS) を外部の Red Hat Ceph Storage クラスターに追加して提供できます。
  • オブジェクトストレージのオブジェクトバケット要求は、Multicloud Object Gateway を使用するか、Ceph Object Gateway を外部の Red Hat Ceph Storage クラスターに追加して提供できます。

以下のプロセスを使用して、ブロックストレージだけを提供するために最初にデプロイされていたファイルストレージ (メタデータサバー 使用)、オブジェクトストレージ (Ceph Object Gateway 使用) または両方を外部の OpenShift Data Foundation クラスターに追加します。

前提条件

  • OpenShift Data Foundation 4.10 が OpenShift Container Platform バージョン 4.10 以降にインストールされ、実行されている。また、外部モードの OpenShift Data Foundation Cluster が Ready 状態にある。
  • 外部の Red Hat Ceph Storage クラスターが以下のいずれかまたは両方で設定されている。

    • オブジェクトストレージ用に OpenShift Container Platform クラスターがアクセスできる Ceph Object Gateway (RGW) エンドポイント
    • ファイルストレージ用のメタデータサーバー (MDS) プール
  • 外部の OpenShift Data Foundation クラスターのデプロイメント時に ceph-external-cluster-details-exporter.py スクリプトで使用されるパラメーターを把握している。

手順

  1. 以下のコマンドを使用して ceph-external-cluster-details-exporter.py Python スクリプトの OpenShift Data Foundation バージョンをダウンロードします。

    oc get csv $(oc get csv -n openshift-storage | grep ocs-operator | awk '{print $1}') -n openshift-storage -o jsonpath='{.metadata.annotations.external\.features\.ocs\.openshift\.io/export-script}' | base64 --decode > ceph-external-cluster-details-exporter.py
  2. 更新パーミッションは、外部の Red Hat Ceph Storage クラスターのクライアントノードで ceph-external-cluster-details-exporter.py を実行して、外部の Red Hat Ceph Storage クラスターを制限します。これを行うには、Red Hat Ceph Storage の管理者に問い合わせる必要がある場合があります。

    # python3 ceph-external-cluster-details-exporter.py --upgrade \
    --run-as-user=ocs-client-name \
    --rgw-pool-prefix rgw-pool-prefix
    --run-as-user
    OpenShift Data Foundation クラスターのデプロイメント時に使用されるクライアント名。別のクライアント名が設定されていない場合は、デフォルトのクライアント名 client.healthchecker を使用します。
    --rgw-pool-prefix
    Ceph Object Gateway プールに使用する接頭辞。デフォルトの接頭辞を使用している場合は、省略できます。
  3. 外部の Red Hat Ceph Storage クラスターから設定詳細を生成して保存します。

    1. 外部の Red Hat Ceph Storage クラスターのクライアントノードで ceph-external-cluster-details-exporter.py を実行して、設定の詳細を生成します。

      # python3 ceph-external-cluster-details-exporter.py --rbd-data-pool-name rbd-block-pool-name --monitoring-endpoint ceph-mgr-prometheus-exporter-endpoint --monitoring-endpoint-port ceph-mgr-prometheus-exporter-port --run-as-user ocs-client-name  --rgw-endpoint rgw-endpoint --rgw-pool-prefix rgw-pool-prefix
      --monitoring-endpoint
      オプション。OpenShift Container Platform クラスターから到達可能な、アクティブ mgr およびスタンバイ mgr の IP アドレスのコンマ区切りリストを受け入れます。指定しない場合には、値が自動的に入力されます。
      --monitoring-endpoint-port
      オプション。--monitoring-endpoint で指定された ceph-mgr Prometheus エクスポーターに関連付けられるポートです。指定しない場合には、値が自動的に入力されます。
      --run-as-user
      OpenShift Data Foundation クラスターのデプロイメント時に使用されるクライアント名。別のクライアント名が設定されていない場合は、デフォルトのクライアント名 client.healthchecker を使用します。
      --rgw-endpoint
      このパラメーターを指定して OpenShift Data Foundation の Ceph Object Gateway でオブジェクトストレージをプロビジョニングします (任意のパラメーター)。
      --rgw-pool-prefix
      Ceph Object Gateway プールに使用する接頭辞。デフォルトの接頭辞を使用している場合は、省略できます。

      ユーザーパーミッションは、以下のように更新されます。

      caps: [mgr] allow command config
      caps: [mon] allow r, allow command quorum_status, allow command version
      caps: [osd] allow rwx pool=default.rgw.meta, allow r pool=.rgw.root, allow rw pool=default.rgw.control, allow rx pool=default.rgw.log, allow x pool=default.rgw.buckets.index
      注記

      Ceph Object Gateway の詳細 (指定されている場合) 以外の全パラメーター (任意の引数を含む) は、OpenShift Data Foundation を外部モードでデプロイした時に使用したものと同じです。

    2. スクリプトの出力を external-cluster-config.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": "<user-id>", "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": "<pool>"}}, {"name": "monitoring-endpoint", "kind": "CephCluster", "data": {"MonitoringEndpoint": "xxx.xxx.xxx.xxx", "MonitoringPort": "xxxx"}}, {"name": "rook-ceph-dashboard-link", "kind": "Secret", "data": {"userID": "ceph-dashboard-link", "userKey": "<user-key>"}}, {"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"}}, {"name": "rgw-admin-ops-user", "kind": "Secret", "data": {"accessKey": "<access-key>", "secretKey": "<secret-key>"}}]
  4. 生成された JSON ファイルをアップロードします。

    1. OpenShift Web コンソールにログインします。
    2. WorkloadsSecrets をクリックします。
    3. プロジェクトopenshift-storage に設定します。
    4. rook-ceph-external-cluster-details をクリックします。
    5. Actions (⋮) → Edit Secret をクリックします。
    6. Browse をクリックして external-cluster-config.json ファイルをアップロードします。
    7. Save をクリックします。

検証手順

  • OpenShift Data Foundation クラスターが正常であり、データが回復性があることを確認するには、StorageData foundationStorage Systems タブに移動してから、ストレージシステム名をクリックします。

    • OverviewBlock and File タブで Status カードをチェックして、Storage Cluster に正常であることを示す緑色のチェックマークが表示されていることを確認します。
  • ファイルストレージ用のメタデータサーバー (MDS) を追加した場合:

    1. WorkloadsPods をクリックして、csi-cephfsplugin-* Pod が新規作成され、状態が Running であることを確認します。
    2. StorageStorage Classes をクリックして ocs-external-storagecluster-cephfs ストレージクラスが作成されていることを確認します。
  • オブジェクトストレージ用に Ceph Object Gateway を追加した場合:

    1. StorageStorage Classes をクリックして ocs-external-storagecluster-ceph-rgw ストレージクラスが作成されていることを確認します。
    2. OpenShift Data Foundation クラスターが正常であり、データが回復性があることを確認するには、StorageData foundationStorage Systems タブに移動してから、ストレージシステム名をクリックします。
    3. Object タブをクリックして、Object Service および Data resiliency に正常であることを示す緑色のチェックマークが表示されていることを確認します。