4.8. デプロイメントの確認
以下の手順を実行してデプロイメントを確認します。
コンバージドモードのインストール検証
以下のコマンドを実行して、app-storage namespace のインストールを検証します。これは、OCP マスターノード、または OC CLI がインストールされている Ansible デプロイホストから実行できます。
# switch to the app-storage namespace oc project app-storage # get the list of pods here (3 gluster pods +1 heketi pod + 1 gluster block provisioner pod) oc get pods NAME READY STATUS RESTARTS AGE glusterblock-storage-provisioner-dc-1-mphfp 1/1 Running 0 1h glusterfs-storage-6tlzx 1/1 Running 0 1h glusterfs-storage-lksps 1/1 Running 0 1h glusterfs-storage-nf7qk 1/1 Running 0 1h glusterfs-storage-tcnd8 1/1 Running 0 1h heketi-storage-1-5m6cl 1/1 Running 0 1h
以下のコマンドを実行して、infra-storage namespace のインストールを検証します。これは、OCP マスターノード、または OC CLI がインストールされている Ansible デプロイホストから実行できます。
# switch to the infra-storage namespace oc project infra-storage # list the pods here (3 gluster pods, 1 heketi pod and 1 glusterblock-provisioner pod) oc get pods NAME READY STATUS RESTARTS AGE glusterblock-registry-provisioner-dc-1-28sfc 1/1 Running 0 1h glusterfs-registry-cjp49 1/1 Running 0 1h glusterfs-registry-lhgjj 1/1 Running 0 1h glusterfs-registry-v4vqx 1/1 Running 0 1h heketi-registry-5-lht6s 1/1 Running 0 1h
OCP インフラストラクチャー Red Hat Openshift Container Storage がサポートするレジストリー PVC が存在することを確認します。このボリュームは、openshift-ansible デプロイメントで静的にプロビジョニングされました。
oc get pvc -n default NAME STATUS VOLUME CAPACITY ACCESSMODES STORAGECLASS AGE registry-claim Bound pvc-7ca4c8de-10ca-11e8-84d3-069df2c4f284 25Gi RWX 1h
レジストリー DeploymentConfig を確認して、この glusterfs ボリュームを使用していることを確認します。
oc describe dc/docker-registry -n default | grep -A3 Volumes Volumes: registry-storage: Type: PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace) ClaimName: registry-claim
コンバージドモードのストレージプロビジョニングの検証
ストレージクラスリソースを使用して、RHOCSデプロイメントを検証するための新しいPV要求を作成できます。RHOCS デプロイメント時に作成された以下の OCP Storage Class を使用して、PV プロビジョニングを検証します。
- 「コンバージドモードでのRed Hat Openshift Container Storageのデプロイ」 を使用して RHOCS をデプロイした場合に、glusterfs-storage-block OCP Storage Class リソースを使用して新規永続ボリューム要求を作成します。
以下のワークフローのいずれかを使用して RHOCS をデプロイした場合は、glusterfs-registry-block OCP Storage Class リソースを使用して新規永続ボリューム要求を作成します。
# oc get storageclass NAME TYPE glusterfs-storage kubernetes.io/glusterfs glusterfs-storage-block gluster.org/glusterblock $ cat pvc-file.yaml kind: PersistentVolumeClaim apiVersion: v1 spec: name: rhocs-file-claim1 annotations: storageClassName: glusterfs-storage spec: accessModes: - ReadWriteMany resources: requests: storage: 5Gi
# cat pvc-block.yaml kind: PersistentVolumeClaim apiVersion: v1 spec: name: rhocs-block-claim1 annotations: storageClassName: glusterfs-storage-block spec: accessModes: - ReadWriteOnce resources: requests: storage: 5Gi
# oc create -f pvc-file.yaml # oc create -f pvc-block.yaml
2 つの PVC とそれぞれの PV が適切に作成されていることを確認します。
# oc get pvc
検証に heketi-client を使用する
heketi-client パッケージは、Ansible デプロイホストまたは OCP マスターにインストールする必要があります。インストールしたら、heketi-clientコマンド(heketi-cli)を実行するための必要な環境変数を簡単にエクスポートするために、2つの新しいファイルを作成する必要があります。各ファイルの内容と便利な heketi-cli コマンドの詳細を以下に示します。
以下の内容を含む新規ファイル(例: "heketi-exports-app")を作成します。
export HEKETI_POD=$(oc get pods -l glusterfs=heketi-storage-pod -n app-storage -o jsonpath="{.items[0].metadata.name}") export HEKETI_CLI_SERVER=http://$(oc get route/heketi-storage -n app-storage -o jsonpath='{.spec.host}') export HEKETI_CLI_KEY=$(oc get pod/$HEKETI_POD -n app-storage -o jsonpath='{.spec.containers[0].env[?(@.name=="HEKETI_ADMIN_KEY")].value}') export HEKETI_ADMIN_KEY_SECRET=$(echo -n ${HEKETI_CLI_KEY} | base64) export HEKETI_CLI_USER=admin
ファイルをソースして、HEKETI app-storage 環境変数を作成します。
source heketi-exports-app # see if heketi is alive curl -w '\n' ${HEKETI_CLI_SERVER}/hello Hello from Heketi # ask heketi about the cluster it knows about heketi-cli cluster list Clusters: Id:56ed234a384cef7dbef6c4aa106d4477 [file][block] # ask heketi about the topology of the RHOCS cluster for apps heketi-cli topology info # ask heketi about the volumes already created (one for the heketi db should exist after the OCP initial installation) heketi-cli volume list Id:d71a4cbea22af3453615a9020f261b5c Cluster:56ed234a384cef7dbef6c4aa106d4477 Name:heketidbstorage
以下の内容を含む新規ファイル(例: "heketi-exports-infra")を作成します。
export HEKETI_POD=$(oc get pods -l glusterfs=heketi-registry-pod -n infra-storage -o jsonpath="{.items[0].metadata.name}") export HEKETI_CLI_SERVER=http://$(oc get route/heketi-registry -n infra-storage -o jsonpath='{.spec.host}') export HEKETI_CLI_USER=admin export HEKETI_CLI_KEY=$(oc get pod/$HEKETI_POD -n infra-storage -o jsonpath='{.spec.containers[0].env[?(@.name=="HEKETI_ADMIN_KEY")].value}') export HEKETI_ADMIN_KEY_SECRET=$(echo -n ${HEKETI_CLI_KEY} | base64)
ファイルをソースして、HEKETI infra-storage 環境変数を作成します。
source heketi-exports-infra # see if heketi is alive curl -w '\n' ${HEKETI_CLI_SERVER}/hello Hello from Heketi # ask heketi about the cluster it knows about (the RHOCS cluster for infrastructure) heketi-cli cluster list Clusters: Id:baf91b261cbca2bb4b62caece63f60d0 [file][block] # ask heketi about the volumes already created heketi-cli volume list Id:77baed02f79f4518326d8cc1db6c7af8 Cluster:baf91b261cbca2bb4b62caece63f60d0 Name:heketidbstorage