OpenShift Container Storage is now OpenShift Data Foundation starting with version 4.9.
第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.9 が OpenShift Container Platform バージョン 4.9 以降にインストールされ、実行されている。また、外部モードの 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
スクリプトで使用されるパラメーターを把握している。
手順
以下のコマンドを使用して
ceph-external-cluster-details-exporter.py
Python スクリプトの OpenShift Data Foundation バージョンをダウンロードします。Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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
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
更新パーミッションは、外部の Red Hat Ceph Storage クラスターのクライアントノードで
ceph-external-cluster-details-exporter.py
を実行して、外部の Red Hat Ceph Storage クラスターに制限を課します。これを行うには、Red Hat Ceph Storage の管理者に問い合わせる必要がある場合があります。Copy to Clipboard Copied! Toggle word wrap Toggle overflow python3 ceph-external-cluster-details-exporter.py --upgrade \ --run-as-user=ocs-client-name \ --rgw-pool-prefix rgw-pool-prefix
# 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 プールに使用する接頭辞。デフォルトの接頭辞を使用している場合は、省略できます。
外部の Red Hat Ceph Storage クラスターから設定詳細を生成して保存します。
外部の Red Hat Ceph Storage クラスターのクライアントノードで
ceph-external-cluster-details-exporter.py
を実行して、設定の詳細を生成します。Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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
# 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 プールに使用する接頭辞。デフォルトの接頭辞を使用している場合は、省略できます。
ユーザーパーミッションは、以下のように更新されます。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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
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 を外部モードでデプロイした時に使用したものと同じです。
スクリプトの出力を
external-cluster-config.json
ファイルに保存します。以下の出力例では、生成された設定変更を太字で示しています。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow [{"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>"}}]
[{"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>"}}]
生成された JSON ファイルをアップロードします。
- OpenShift Web コンソールにログインします。
-
Workloads
Secrets をクリックします。 -
プロジェクト を
openshift-storage
に設定します。 - rook-ceph-external-cluster-details をクリックします。
-
Actions (⋮)
Edit Secret をクリックします。 -
Browse をクリックして
external-cluster-config.json
ファイルをアップロードします。 - Save をクリックします。
検証手順
OpenShift Data Foundation クラスターが正常であり、データが回復性があることを確認するには、Storage
OpenShift Data foundation Storage Systems タブに移動してから、ストレージシステム名をクリックします。 -
Overview
Block and File タブで Status カードをチェックして、Storage Cluster に正常であることを示す緑色のチェックマークが表示されていることを確認します。
-
Overview
ファイルストレージ用のメタデータサーバー (MDS) を追加した場合:
-
Workloads
Pods をクリックして、 csi-cephfsplugin-*
Pod が新規作成され、状態が Running であることを確認します。 -
Storage
Storage Classes をクリックして ocs-external-storagecluster-cephfs
ストレージクラスが作成されていることを確認します。
-
Workloads
オブジェクトストレージ用に Ceph Object Gateway を追加した場合:
-
Storage
Storage Classes をクリックして ocs-external-storagecluster-ceph-rgw
ストレージクラスが作成されていることを確認します。 -
OpenShift Data Foundation クラスターが正常であり、データが回復性があることを確認するには、Storage
OpenShift Data foundation Storage Systems タブに移動してから、ストレージシステム名をクリックします。 - Object タブをクリックして、Object Service および Data resiliency に正常であることを示す緑色のチェックマークが表示されていることを確認します。
-
Storage