第9章 ストレージのバックエンドとしての Red Hat Openshift Container Storage を使用したレジストリーの更新
OpenShift Container Platform は、自動的にセットアップされる NFS がサポートする永続ボリュームを使用するストレージで統合レジストリーを提供します。Red Hat Openshift Container Storage では、これをレジストリーストレージの Gluster 永続ボリュームに置き換えることができます。これにより、信頼性、スケーラビリティー、およびフェイルオーバーが向上します。
OpenShift Container Platform および docker-registry の詳細は、https://access.redhat.com/documentation/ja-jp/openshift_container_platform/3.11/html/configuring_clusters/setting-up-the-registry を参照してください。
9.1. Openshift Container Platform レジストリーデプロイメントの検証
レジストリーが適切にデプロイされていることを確認するには、以下のコマンドを実行します。
マスターまたはクライアントで、以下のコマンドを実行し、クラスター管理者としてログインします。
# oc login
以下に例を示します。
# oc login Authentication required for https://master.example.com:8443 (openshift) Username: <cluster-admin-user> Password: <password> Login successful. You have access to the following projects and can switch between them with 'oc project <projectname>': * default management-infra openshift openshift-infra Using project "default".
プロジェクトのデフォルトに自動的にログインしない場合は、以下のコマンドを実行してこれに切り替えます。
# oc project default
Pod が作成されたことを確認するには、以下のコマンドを実行します。
# oc get pods
以下に例を示します。
# oc get pods NAME READY STATUS RESTARTS AGE docker-registry-2-mbu0u 1/1 Running 4 6d docker-registry-2-spw0o 1/1 Running 3 6d registry-console-1-rblwo 1/1 Running 3 6d
エンドポイントが作成されたことを確認するには、以下のコマンドを実行します。
# oc get endpoints
以下に例を示します。
# oc get endpoints NAME ENDPOINTS AGE docker-registry 10.128.0.15:5000,10.129.0.9:5000 7d kubernetes 192.168.234.143:8443,192.168.234.143:8053,192.168.234.143:8053 7d registry-console 10.128.0.17:9090 7d router 192.168.234.144:443,192.168.234.145:443,192.168.234.144:1936 + 3 more... 7d
永続ボリュームが作成されたことを確認するには、以下のコマンドを実行します。
# oc get pv NAME CAPACITY ACCESSMODES RECLAIMPOLICY STATUS CLAIM REASON AGE registry-volume 5Gi RWX Retain Bound default/registry-claim 7d
NFS レジストリー用に作成された永続ボリュームの詳細を取得するには、以下のコマンドを実行します。
# oc describe pv registry-volume Name: registry-volume Labels: <none> StorageClass: Status: Bound Claim: default/registry-claim Reclaim Policy: Retain Access Modes: RWX Capacity: 5Gi Message: Source: Type: NFS (an NFS mount that lasts the lifetime of a pod) Server: cns30.rh73 Path: /exports/registry ReadOnly: false No events.